flaviovdf / fpmc

Implementation of the Factorizing Personalized Markov Chains for Next-Basket Recommendation
BSD 3-Clause "New" or "Revised" License
67 stars 25 forks source link

Cannot import name sgd #5

Closed umbertoDifa closed 7 years ago

umbertoDifa commented 7 years ago

Hi @flaviovdf,

do you know why I get : Cannot import name 'sgd' when running the main file? Indeed no module named sgd is generated during the setup.

Thanks,

Umberto

flaviovdf commented 7 years ago

Can you post the stack trace and how you are running the code? Also, are you executing it from the project folder?

umbertoDifa commented 7 years ago

Hi, thanks for answering. This is the error: selection_001 I am running the main.py from the very same folder the main.py is saved. Also in the picture the error is about the dataio module, I fixed that by adding the line from fpmc import dataio in the init.py file. Anyway after fixing that I get the same error about the sgd module, but this time I don't know how to fix this. Am I supposed to have an sgd.py file somewhere?

Thanks, Umberto

flaviovdf commented 7 years ago

After compiling (make), please try:

PYTHONPATH=. python main.py data.txt 3 model.hr5
umbertoDifa commented 7 years ago

It still gives me the same error. Thanks anyways!

ghost commented 7 years ago

Hey looks like when you use make it creates .so files with strange names and they do not match the normal ones. e.g., fpmc.cpython-35m-x86_64-linux-gnu.so. I had to add fpmc.so in addition to them and use sudo python main.py ... in order to get the code to work. Perhaps this might help.