hughperkins / pytorch

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

Segmentation fault OSX #2

Closed aminert closed 8 years ago

aminert commented 8 years ago

I got this error when trying to import PyTorch under OS X

import PyTorch dlopen(liblua5.1.so, 10): image not found Segmentation fault: 11

hughperkins commented 8 years ago

Hi. I created a travis build for Mac OS X, and managed to get it building. I had to tweak a few things, and it looks like it works now. You can see the build at: https://travis-ci.org/hughperkins/pytorch/builds/112292866 Travis script is at https://github.com/hughperkins/pytorch/blob/master/.travis.yml

Do you want to try pulling down the latest version, and retrying?

aminert commented 8 years ago

Thanks! I got it to work with LUA5.1 (no Luajit). Awesome, will check your build as well.

hughperkins commented 8 years ago

Ah cool :-)

(no Luajit)

Yes. I havent come up with a theory for how to run it in luajit for now. But I'm hoping that most operations will be in c/c++/cuda, and therefore should still run reasonably well. Will see how it goes.

aminert commented 8 years ago

Thanks, it runs very well with a pretty huge network! No lost in performance at all. Some possible memory leaks, will have to check on that (could be from the nn package)

hughperkins commented 8 years ago

Thanks, it runs very well with a pretty huge network! No lost in performance at all

Ok, cool :-)

Some possible memory leaks, will have to check on that

Hmmm, thats quite possible. Memory management at the py/lua interface is a bit tricky. Let me know if you have any test-cases that demonstrate leakage, and I'll take a look.

cjmcmurtrie commented 8 years ago

@aminert May I ask what your procedure to install was? Did you run everything in .travis.yml? Did you manage to run on Python 2.7 at all?

hughperkins commented 8 years ago

travis job output is here: https://travis-ci.org/hughperkins/pytorch/builds and https://travis-ci.org/hughperkins/pytorch/branches

It runs from the travis.yml script eg https://github.com/hughperkins/pytorch/blob/master/.travis.yml

It doesnt currently test python 2.7, though it probably could do so. On ubuntu 15.10, it runs on 2.7 (or ... it used to :-) )

Edit: there is an example of testing against 2.7 here https://github.com/hughperkins/DeepCL/blob/master/.travis.yml , so I can probalby copy some of this across, and see what happens

hughperkins commented 8 years ago

Added py2.7. Ignore the fact the build is marked failure: thats just a typo in a diagnostic command. You can see tha thte py2.7 tests run ok at https://travis-ci.org/hughperkins/pytorch/builds/121571884#L1990

hughperkins commented 8 years ago

(build passes now, with py2.7 added https://travis-ci.org/hughperkins/pytorch/builds/121572921 )

cjmcmurtrie commented 8 years ago

Thanks Hugh