Comments (7)
For the weight file, I'd downloaded, the encoding was in 'latin1' format.
Try passing encoding='latin1' when loading the file.
torch.load(weight_file_path, map_location=torch.device('cpu'), encoding='latin1')
from portraitnet.
Hello, I meet the same problem. Have you fixed it?
from portraitnet.
You don't need to extract them. Just rename them accordingly to the used config file: e.g myexp/mobilenetv2_video_total/single_224_without_group/model_best.pth.tar
.
from portraitnet.
Hi @dong-x16 , Thanks a lot for your impressive work.
I got an error while loading the pre-trained model. Specifically, it was at "checkpoint_video = torch.load(bestModelFile)
" in the file VideoTest.ipynb. Here is the error:
53 if os.path.isfile(bestModelFile):
---> 54 checkpoint_video = torch.load(bestModelFile)
55 netmodel_video.load_state_dict(checkpoint_video['state_dict'])
56 print ("minLoss: ", checkpoint_video['minLoss'], checkpoint_video['epoch'])
1 frames
/usr/local/lib/python3.6/dist-packages/torch/serialization.py in _legacy_load(f, map_location, pickle_module, **pickle_load_args)
763 unpickler = pickle_module.Unpickler(f, **pickle_load_args)
764 unpickler.persistent_load = persistent_load
--> 765 result = unpickler.load()
766
767 deserialized_storage_keys = pickle_module.load(f, **pickle_load_args)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte
Do you think this problem caused by the file "model_best.pth.tar"?
Have a nice day!
Nhat
from portraitnet.
Hi,
I get a similar error when I load the model mobilenetv2_total_with_prior_channel.tar
in VideoTest.ipynb.
I changed the model_root and the model filename accordingly with my folders and files.
---------------------------------------------------------------------------
UnicodeDecodeError Traceback (most recent call last)
<ipython-input-13-0ef5f99e810e> in <module>
51 bestModelFile = os.path.join(exp_args.model_root, 'mobilenetv2_total_with_prior_channel.tar')
52 if os.path.isfile(bestModelFile):
---> 53 checkpoint_video = torch.load(bestModelFile)
54 netmodel_video.load_state_dict(checkpoint_video['state_dict'])
55 print ("minLoss: ", checkpoint_video['minLoss'], checkpoint_video['epoch'])
~\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py in load(f, map_location, pickle_module)
366 f = open(f, 'rb')
367 try:
--> 368 return _load(f, map_location, pickle_module)
369 finally:
370 if new_fd:
~\AppData\Local\Programs\Python\Python36\lib\site-packages\torch\serialization.py in _load(f, map_location, pickle_module)
540 unpickler = pickle_module.Unpickler(f)
541 unpickler.persistent_load = persistent_load
--> 542 result = unpickler.load()
543
544 deserialized_storage_keys = pickle_module.load(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb7 in position 3: ordinal not in range(128)
Looking forward to your reply.
Best regards.
Monica Gruosso
from portraitnet.
as per requirement you need to use python 2.7 not 3.x
from portraitnet.
Hello, have you solved it? I found a decompression error after downloading the model file。
from portraitnet.
Related Issues (14)
- Model tar not extracted
- 您提供的EG1800数据集labels怎么无标签? HOT 5
- 模型测试为什么不能出结果? HOT 1
- Supervisely portrait dataset google drive link
- model .par
- model's dimension doesn't match checkpoint's dimension?
- wonder if you can provide the human dataset used in your third model HOT 1
- Add a License HOT 1
- The mIoU is low HOT 10
- About mask file structure HOT 1
- Model training HOT 3
- resume HOT 1
- some images repeated in Supervisely_face
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 portraitnet.