Closed gulzainali98 closed 3 years ago
Sorry, by default the code seems to use the model resnet_v1_50 but the pre-trained weights resnet_v1_101.
So the download link for resnet_v1_50 is here http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz.
Of course, you can change the model to resnet_v1_101 (see train.py).
python inference.py --coloring 1 --ms 0 --network resnet_v1_101 --weights_ckpt /PSPREVIVAL/PSPNet-TF-Reproduce/z_pretrained_weights/resnet_v1_101.ckpt --image_path images/real/rgb2.jpg
Even when i specifiy in the command to use resnet_v1_101, it still shows the same error but with resenet_v1_101 this time.
Tensor name "resnet_v1_101/block4/unit_4/BatchNorm/beta" not found in checkpoint files /PSPREVIVAL/PSPNet-TF-Reproduce/z_pretrained_weights/resnet_v1_101.ckpt [[node save/RestoreV2 (defined at inference.py:71) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
Error persists even when i repeat the process with resnet_v1_50 I am putting the pre trained weights in the z_pretrained_weights folder
When inferring an image, the weights_ckpt should be a trained model.
The resnet_v1_101.ckpt
is a pretrained classification model on ImageNet. It has no weights for the new layers created for segmentation model. And resnet_v1_101/block4/unit_4/BatchNorm/beta
is a new layer. That's why it was not found in renset_v1_101.ckpt
.
where can i get pretrained model for segmentation?
same here
same here :/
Sorry guys, this repo is mainly for reproducing the training phase of PSPNet. There is only ImageNet-pretrained model in public, which is what I used for training. I didn't provide segmentation trained models, while the official repo did, link.
To get a trained model for segmentation in Pytorch, you can see here: https://hangzhang.org/PyTorch-Encoding/model_zoo/segmentation.html.
model not loading. It gives an error. Below is the error.
Tensor name "resnet_v1_50/block1/unit_1/bottleneck_v1/conv1/BatchNorm/beta" not found in checkpoint files /PSPNET/PSPNet-TF-Reproduce/z_pretrained_weights/resnet_v1_101.ckpt [[node save/RestoreV2 (defined at inference.py:71) = RestoreV2[dtypes=[DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, ..., DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT, DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
What could be the problem? I downloaded the model from .sh file given in the code.