Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows is not supported? #12

Closed
xiaoyongzhu opened this issue Nov 30, 2017 · 7 comments
Closed

Windows is not supported? #12

xiaoyongzhu opened this issue Nov 30, 2017 · 7 comments

Comments

@xiaoyongzhu
Copy link

I am using this torch file (https://s3.amazonaws.com/xunhuang-public/adain/vgg_normalised.t7) and is using the following line of code to load it:

t7 = torchfile.load(t7_file, force_8bytes_long=False)

Looks like it works in Linux, but it doesn't work in Windows. Error message is:

    t7 = torchfile.load(t7_file, force_8bytes_long=False)
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 424, in load
    return reader.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 370, in read_obj
    obj._obj = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 385, in read_obj
    k = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 386, in read_obj
    v = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 370, in read_obj
    obj._obj = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 387, in read_obj
    obj[k] = v
TypeError: unhashable type: 'list'

Looks like something is wrong here? How should I fix it?

@bshillingford
Copy link
Owner

bshillingford commented Nov 30, 2017 via email

@xiaoyongzhu
Copy link
Author

@bshillingford Thanks for the reply! I have turned off it:

    t7 = torchfile.load(t7_file, force_8bytes_long=False, use_list_heuristic = False)

However there's still some problem:

    obj._obj = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 385, in read_obj
    k = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 386, in read_obj
    v = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 370, in read_obj
    obj._obj = self.read_obj()
  File "C:\Program Files\Python36\lib\site-packages\torchfile.py", line 387, in read_obj
    obj[k] = v
TypeError: unhashable type: 'numpy.ndarray'

which is in the same line.

Looks like it's still not working. BTW - the same piece of code and data can work in Ubuntu, but not in Windows, so i suspect it's something related with the OS.

@bshillingford
Copy link
Owner

bshillingford commented Nov 30, 2017 via email

@xiaoyongzhu
Copy link
Author

I can help to host a windows VM on the cloud for you to test if you want to fix it (sorry I really don't have experience in dealing with Lua/Torch so can't help much here). You can find my email in my github introduction page.

@Dunimon
Copy link

Dunimon commented Dec 20, 2018

I tried to load the same model (https://s3.amazonaws.com/xunhuang-public/adain/vgg_normalised.t7) with the command

 torch_model = torchfile.load(t7_file, force_8bytes_long=True)

and it seems working on windows. Honestly, I don't know what the parameters force_8bytes_long is really related to. I mean, the size of the long type is 8 bytes and (do not hesitate to tell me if I'm wrong) that's the case for any languages (lua, python etc..). There is no full documentation (not yet I think) of torchfile libary but we can try figure out what is going on (https://github.com/bshillingford/python-torchfile).

@soumith
Copy link

soumith commented Dec 20, 2018

@Dunimon on Windows the size of long is 4 bytes.

@dexter2406
Copy link

I tried to load the same model (https://s3.amazonaws.com/xunhuang-public/adain/vgg_normalised.t7) with the command

 torch_model = torchfile.load(t7_file, force_8bytes_long=True)

and it seems working on windows. Honestly, I don't know what the parameters force_8bytes_long is really related to. I mean, the size of the long type is 8 bytes and (do not hesitate to tell me if I'm wrong) that's the case for any languages (lua, python etc..). There is no full documentation (not yet I think) of torchfile libary but we can try figure out what is going on (https://github.com/bshillingford/python-torchfile).

This works, but it requires python2.x, because it involves xrange... hmmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants