bstriner / keras-tqdm

Keras integration with TQDM progress bars
MIT License
348 stars 41 forks source link

install issue? #1

Closed tentrillion closed 7 years ago

tentrillion commented 7 years ago

I'm using Python 3.5.2 from Anaconda on a Windows 7 machine in a Jupyter notebook.

'3.5.2 |Continuum Analytics, Inc.| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]'

After I installed (by git clone and then python setup.py install, it seems as if an .egg file appeared in the expected place in my conda tensorflow environment, and on from keras_tqdm import TQDMCallback it tries to look there for the installation but is not finding it correctly.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-6e076365bc4a> in <module>()
      1 # using better progress bars using https://github.com/bstriner/keras-tqdm/
      2 
----> 3 from keras_tqdm import TQDMCallback, TQDMNotebookCallback

C:\Anaconda2\envs\tensorflow\lib\site-packages\keras_tqdm-0.0.1-py3.5.egg\keras_tqdm\__init__.py in <module>()
----> 1 from tqdm_callback import TQDMCallback
      2 from tqdm_notebook_callback import TQDMNotebookCallback

ImportError: No module named 'tqdm_callback'

This can be fixed by doing an sys.path.insert(1, 'C:/<PATH>/keras-tqdm/keras_tqdm/') to put the correct directory ahead of the non-working one in the sys.path, but that isn't ideal.

Note that this is after pulling the updates from yesterday.

All in all, this is a minor problem to a very nice solution to the keras progbars freezing in Jupyter problem. Thank you!

bstriner commented 7 years ago

Thanks for all the info! Never would've known there was a problem without you.

The fix I made was to add dots (relative paths) in __init__.py like below. https://github.com/bstriner/keras-tqdm/blob/master/keras_tqdm/__init__.py

from .tqdm_callback import TQDMCallback
from .tqdm_notebook_callback import TQDMNotebookCallback

Whereas this is the broken version:

from tqdm_callback import TQDMCallback
from tqdm_notebook_callback import TQDMNotebookCallback

The code in your stacktrace doesn't have the dots, so for some reason the install didn't get the latest updates. Might have to pip uninstall keras-tqdm and reinstall after pulling the latest changes.

I'll try to get this up on PyPI at some point soon.

Cheers, Ben

bstriner commented 7 years ago

Up on PyPI! Tested on a clean machine and appears to be working fine. Can now install with just pip install keras-tqdm.

tentrillion commented 7 years ago

I installed from pip on a different machine today and can verify everything works great. Nice work!