Tramac / awesome-semantic-segmentation-pytorch

Semantic Segmentation on PyTorch (include FCN, PSPNet, Deeplabv3, Deeplabv3+, DANet, DenseASPP, BiSeNet, EncNet, DUNet, ICNet, ENet, OCNet, CCNet, PSANet, CGNet, ESPNet, LEDNet, DFANet)
Apache License 2.0
2.83k stars 581 forks source link

Pickle Error when loading trained model #174

Closed ZuoYuShen closed 3 years ago

ZuoYuShen commented 3 years ago

I train deeplabv3 based on this repo. However, when running eval.py, I got this error: _pickle.UnpicklingError: invalid load key, '\x09'.

Tramac commented 3 years ago

Hi, Can you log more detailed log?

ZuoYuShen commented 3 years ago

Hi, Can you log more detailed log?

Yes. I train Deeplabv3 with ResNet50 backbone. Then I run eval.py, it's output: python3 eval.py --model deeplabv3 --backbone resnet50 --dataset citys Found 500 images in the folder /ZuoYS/Cityscapes/leftImg8bit/val Traceback (most recent call last): File "eval.py", line 113, in evaluator = Evaluator(args) File "eval.py", line 51, in init norm_layer=BatchNorm2d).to(self.device) File "/ZuoYS/awesome-semantic-segmentation-pytorch/core/models/model_zoo.py", line 122, in get_segmentation_model return modelsmodel File "/ZuoYS/awesome-semantic-segmentation-pytorch/core/models/deeplabv3.py", line 156, in get_deeplabv3 map_location=device)) File "/usr/local/lib64/python3.6/site-packages/torch/serialization.py", line 529, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/usr/local/lib64/python3.6/site-packages/torch/serialization.py", line 702, in _legacy_load result = unpickler.load() _pickle.UnpicklingError: invalid load key, '\x09'.

Tramac commented 3 years ago

What is the pytorch version?

ZuoYuShen commented 3 years ago

What is the pytorch version?

My pytorch version is 1.4.0, torchvision 0.5.0.

Tramac commented 3 years ago

Maybe you can try pytorch=1.1.0