TP-GAN
TP-GAN copied to clipboard
pickle 报错
您好,您用的pickle模块的版本号是多少?
我在执行这一句时
self.data_dict = pickle.load(file)
遇到错误
·UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 0: illegal multibyte sequence·
Hello, are you using python 3? If yes, there is some pickle between python version problem.
Instead of
self.data_dict = pickle.load(file)
Please try this code:
with open('path/to/your/pickle/file','rb') as file: # Binary read
u = pickle._Unpickler(file)
u.encoding = 'latin1'
p = u.load()
self.data_dict = p