Indeed the problem was that I had multiple versions of Python.
Removing Anaconda Python and installing all libraries using pip/apt-get instead of conda solved my problem.
Ho trovato che questo è vero ma non è necessario eliminare anaconda. Ho avuto lo stesso problema ma con più versioni di Python. Tuttavia, ho creato un ambiente che utilizzava solo la versione Anaconda (mentre in quell'ambiente). Nel terminale (sul mac e altri terminali adatti), tipo/copia
conda create -n dataweekends python=2.7 pandas scikit-learn jupyter matplotlib
dataweekends è semplicemente il nome dell'ambiente creata. Per accedere a questo, basta usare il comando
source activate dataweekends
Essere consapevoli che si potrebbe (forse) essere necessario reinstallare dipendenze una volta in questo nuovo ambiente.
ho avuto questo trucco da qui "https://www.dataweekends.com/blog/2017/03/09/set-up-your-mac-for-deep-learning-with-python-keras-and-tensorflow"
Auspico inoltre la creazione di ambienti diversi per ogni progetto si fa in python.
Avete più versioni Python? Per quale hai installato keras? – Selcuk
Grazie buona domanda. Effettivamente ho più versioni di python, ma l'ho installato per 2.7 e l'ho provato anche con 2.7. –
E se guardo nella cartella con i pacchetti, c'è anche: '/usr/local/lib/python2.7/dist-packages/keras/datasets$ ls cifar100.py cifar10.py cifar.py data_utils .py imdb.py __init__.py mnist.py reuters.py cifar100.pyc cifar10.pyc cifar.pyc data_utils.pyc imdb.pyc __init __. pyc mnist.pyc reuters.pyc' –