hughperkins / pytorch

Python wrappers for torch and lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

torch-hdf5 causes pytorch to choke

lebedov opened this issue · comments

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.

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.

Cool! Good info :-)

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