When i am trying to use serialization i had obtained the following error is there any other way to do the same thing?


#1

ModuleNotFoundError: No module named ‘torch.utils.serialization’


#2

Could you post the code which is throwing this error?


#3

I haven’t given full code i have just given glimpse of it and since i am new to deeplearning i have picked up this code from github page https://github.com/szagoruyko/cvpr15deepcompare in pytorch, eval.py

from torch.utils.serialization import load_lua
import argparse
parser = argparse.ArgumentParser(description=‘DeepCompare PyTorch evaluation code’)

here deep* represents the functions

models = {
‘2ch’: deepcompare_2ch,
‘2ch2stream’: deepcompare_2ch2stream,
‘siam’: deepcompare_siam,
‘siam_l2’: deepcompare_siam_l2,
‘siam2stream’: deepcompare_siam2stream,
‘siam2stream_l2’: deepcompare_siam2stream_l2,
}
def main(args):
opt = parser.parse_args(args)
print(‘parsed options:’, vars(opt))

f = models[opt.model]
net = load_lua(opt.lua_model)

#4

Thanks for the code.
You issue seems to be related to this one.


#5

I have seen this but unable to understand is there any alternative in pytorch for torch.utils.serialization and load_lua.


#6

Based on the information from the issue you would have to use PyTorch 0.4.1 or torchfile.