clcarwin / convert_torch_to_pytorch

Convert torch t7 model to pytorch model and source.
MIT License
540 stars 161 forks source link

Error: cPickle.UnpicklingError: invalid load key, ''. #27

Open InderpreetSinghChhabra01 opened 6 years ago

InderpreetSinghChhabra01 commented 6 years ago

I use the following code to convert torch method to overcome this error: convert torch 7 model and get an error : AttributeError: type object 'torch.cuda.FloatStorage' has no attribute 'from_buffer'

But soon after the first step i.e. loading the model I got the error: cPickle.UnpicklingError: invalid load key, ''.

m = torch.load('xxxx.t7') m = m:float() torch.save('xxxx.cpu.t7',m)

I have used the model of cycle gas trained in torch, I will be grateful if you can look into this, Thankyou in advance

yanxianghuang commented 6 years ago

Same here.

prajwal-y commented 6 years ago

Just import the following, and it should work.

require 'torch' require 'optim' require 'paths' require 'xlua' require 'csvigo' require 'nn' require 'dpnn' require 'cudnn'

You may not need all of them though.