naoto0804 / pytorch-AdaIN

Unofficial pytorch implementation of 'Arbitrary Style Transfer in Real-time with Adaptive Instance Normalization' [Huang+, ICCV2017]
MIT License
1.08k stars 208 forks source link

No module named 'torch.utils.serialization' #25

Closed KokeCacao closed 5 years ago

KokeCacao commented 5 years ago
python torch_to_pytorch.py --model models/vgg_normalised.t7
Traceback (most recent call last):
  File "torch_to_pytorch.py", line 9, in <module>
    from torch.utils.serialization import load_lua
ModuleNotFoundError: No module named 'torch.utils.serialization'

It seems like the function is long removed by pytorch: https://stackoverflow.com/questions/54107156/modulenotfounderror-no-module-named-torch-utils-serialization

We should use https://github.com/bshillingford/python-torchfile instead.

naoto0804 commented 5 years ago

Thank you for the suggestion! I'm now thinking of dropping support for converting torch to pytorch since it's very old. If you want to get the converted weight, please refer to #21

naoto0804 commented 5 years ago

I have updated the code to work on pytorch 1.2.0 #26. I also share the converted version of the models (see here).