Comments (14)
@ZhangYuef Thanks for sharing!
Not sure why this error is popped up like
model = DexiNet()
model.load_state_dict(torch.load('24_model.pth'))
RuntimeError Traceback (most recent call last)
in
1 model = DexiNet()
----> 2 model.load_state_dict(checkpoint)
3 print('done')/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
1043 if len(error_msgs) > 0:
1044 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
-> 1045 self.class.name, "\n\t".join(error_msgs)))
1046 return _IncompatibleKeys(missing_keys, unexpected_keys)
1047RuntimeError: Error(s) in loading state_dict for DexiNet:
size mismatch for dblock_3.denselayer1.conv1.weight: copying a param with shape torch.Size([256, 128, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 128, 1, 1]).
size mismatch for dblock_3.denselayer2.conv1.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for dblock_4.denselayer1.conv1.weight: copying a param with shape torch.Size([512, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 256, 1, 1]).
size mismatch for dblock_4.denselayer2.conv1.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for dblock_4.denselayer3.conv1.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for dblock_5.denselayer1.conv1.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for dblock_5.denselayer2.conv1.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for dblock_5.denselayer3.conv1.weight: copying a param with shape torch.Size([512, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([512, 512, 1, 1]).
size mismatch for dblock_6.denselayer1.conv1.weight: copying a param with shape torch.Size([256, 512, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 512, 1, 1]).
size mismatch for dblock_6.denselayer2.conv1.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
size mismatch for dblock_6.denselayer3.conv1.weight: copying a param with shape torch.Size([256, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([256, 256, 1, 1]).
But, I changed the first convolution layer of _DenseLayer with kernel=3 and padding=1, then I could successfully load the checkpoint.
class _DenseLayer(nn.Sequential):
def __init__(self, input_features, out_features):
super(_DenseLayer, self).__init__()
# self.add_module('relu2', nn.ReLU(inplace=True)),
self.add_module('conv1', nn.Conv2d(input_features, out_features,
kernel_size=3, stride=1, padding=1, bias=True)),
self.add_module('norm1', nn.BatchNorm2d(out_features)),
self.add_module('relu1', nn.ReLU(inplace=True)),
self.add_module('conv2', nn.Conv2d(out_features, out_features,
kernel_size=3, stride=1, padding=1, bias=True)),
self.add_module('norm2', nn.BatchNorm2d(out_features))
# double check the norm1 comment if necessary and put norm after conv2
def forward(self, x):
x1, x2 = x
# maybe I should put here a RELU
new_features = super(_DenseLayer, self).forward(F.relu(x1)) # F.relu()
return 0.5 * (new_features + x2), x2
from dexined.
This is a checkpoint from epoch 24 trained on BIPED dataset. Download link is here.
Training result is as the following:
Hope this unofficial one can help : )i have placed this file in checkpoint folder and in 24/ i am getting this error
Error(s) in loading state_dict for DexiNed:
Missing key(s) in state_dict: "block_cat.conv.weight", "block_cat.conv.bias", "block_cat.bn.weight", "block_cat.bn.bias", "block_cat.bn.running_mean", "block_cat.bn.running_var".
Unexpected key(s) in state_dict: "block_cat.weight", "block_cat.bias".
Sorry to forget mention, this checkpoint is trained based on the model of commit a9f6ade. Link from here.
from dexined.
Hi @LionXFQ sorry I will update the DexiNed-Pytorch weights soon, I am preparing the DexiNed extension in pytorch version
from dexined.
Also looking forward to the pretrained weights for Pytorch model.
from dexined.
+1 here too.
from dexined.
Sorry guys it will take a little longer, I cannot turn on my PC in the LAB, working remotely. But hope solve this issue in the coming days and update the DexiNed-Pytorch checkpoint
Cheers.
Xavier
from dexined.
Sorry guys it will take a little longer, I cannot turn on my PC in the LAB, working remotely. But hope solve this issue in the coming days and update the DexiNed-Pytorch checkpoint
Cheers.
Xavier
I have trained one on BIPED dataset myself. I can share if it may help anyone.
from dexined.
Sorry guys it will take a little longer, I cannot turn on my PC in the LAB, working remotely. But hope solve this issue in the coming days and update the DexiNed-Pytorch checkpoint
Cheers.
XavierI have trained one on BIPED dataset myself. I can share if it may help anyone.
please share
from dexined.
This is a checkpoint from epoch 24 trained on BIPED dataset. Download link is here.
BTW, this checkpoint is trained based on the model of commit. Link here.
Training result is as the following:
Hope this unofficial one can help : )
from dexined.
This is a checkpoint from epoch 24 trained on BIPED dataset. Download link is here.
Training result is as the following:
Hope this unofficial one can help : )
i have placed this file in checkpoint folder and in 24/ i am getting this error
Error(s) in loading state_dict for DexiNed:
Missing key(s) in state_dict: "block_cat.conv.weight", "block_cat.conv.bias", "block_cat.bn.weight", "block_cat.bn.bias", "block_cat.bn.running_mean", "block_cat.bn.running_var".
Unexpected key(s) in state_dict: "block_cat.weight", "block_cat.bias".
from dexined.
Thanks @soomiles for pointing out ! I did change the model layer as you point out as the official code had dimension error at that time. : )
Let's wait for the official one!
from dexined.
Hi. Is the official PyTorch pretrained model available yet?
from dexined.
Hi. Is the official PyTorch pretrained model available yet?
Hi sorry, now you can find the official one.
from dexined.
Sorry guys it will take a little longer, I cannot turn on my PC in the LAB, working remotely. But hope solve this issue in the coming days and update the DexiNed-Pytorch checkpoint
Cheers.
XavierI have trained one on BIPED dataset myself. I can share if it may help anyone.
Please do. and send the link. Thanks
from dexined.
Related Issues (20)
- ValueError in TF2 model
- Testing on a single image (lena_std.tif) HOT 3
- about evaluation HOT 2
- Works once but stops working after testing own image HOT 3
- Can I change the resize value in dataset transform function? HOT 3
- About Bsds and Biped HOT 2
- Size of the CLASSIC images
- About args.double_img HOT 5
- Can't parse 'dsize'. Sequence item with index 0 has a wrong type HOT 2
- Should the l_weight value change according to the dataset? HOT 3
- Inference mode is available? HOT 2
- GT HOT 1
- loss does not converge HOT 25
- How can I calculate ODS, OIS, AP metrics? HOT 5
- does DexiNed support multiple GPUs .. if Yes, how to implement it for DexiNed TF2 HOT 4
- high train loss
- About Precision-Recall Curves on Biped
- Getting an NoneType error while testing with my images HOT 1
- Unable to reproduce results HOT 7
- Interpretation of result.png HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexined.