hughperkins / pytorch

Python wrappers for torch and lua
BSD 2-Clause "Simplified" License
431 stars 70 forks source link

torch-hdf5 causes pytorch to choke #22

Closed lebedov closed 8 years ago

lebedov commented 8 years ago

I have torch-hdf5 installed in my torch-cl installation. Although I can successfully access the hdf5 functions in that rock from within trepl, I observe the following error when I try adding require 'hdf5' to a Lua file containing an otherwise loadable class and loading the latter with PyTorch:

PANIC: unprotected error in call to Lua API (...projects/torch-cl/install/share/lua/5.1/hdf5/ffi.lua:3: module 'bit' not found:

Oddly, I can access the support for bit operations when I'm in trepl. Any idea why the torch-hdf5 rock elicits the above error?

I'm using pytorch 65e8871 and revision c77d374 of the hughperkins/distro repo with Python 2.7.12 on MacOS 10.11.6.

lebedov commented 8 years ago

Manually installing LuaBitOp in my torch-cl installation made the problem go away. Perhaps the problem was that trepl is run by LuaJIT (which has built-in bit operation support), whereas pytorch is using the Lua API directly and hence would not have any access to the bit support if it were not explicitly installed and made available to Lua.

hughperkins commented 8 years ago

Cool! Good info :-)

lebedov commented 8 years ago

Also asked the torch-hdf5 developers to explicitly document the bit operation support dependency :-)