davidADSP / GDL_code

The official code repository for examples in the O'Reilly book 'Generative Deep Learning'
GNU General Public License v3.0
1.47k stars 739 forks source link

No module named 'utils.loaders' #84

Open claudiofernandez opened 3 years ago

claudiofernandez commented 3 years ago

I am facing a problem when trying to import modules that are inside the folders. For instance in the notebook "03_01_autoencoder_train.ipynb" in the first cell when trying to import the module loaders.py inside the utils folder in order to load the mnist dataset, I get the error "ModuleNotFoundError: No module named 'utils.loaders'".

In the same sense, for instance in the notebook "03_05_vae_faces_train" again in the first cell, when it tries to run the line "from models.VAE import VariationalAutoEncoder" it tries to run the VAE.py inside the folder "models" it also fails in the line "from utils.callbacks import CustomCallback, step_decay_schedule" showing the following error: "ModuleNotFoundError: No module named 'utils.callbacks'".

It seems that it cannot recognize the utils folder in my directory.

I am running this from a jupyter notebook of an Anaconda environment created following step by step the instructions in the book.

Has anyone faced a similar issue? Can anyone help me?

bransonli commented 3 years ago

Mine works fine in Vscode. Maybe try vscode instead of jupyter notebook, then select the same Anaconda environment.

JerryJohnThomas commented 3 years ago

trying putting tensorflow.utils and also in VAE, change the errors by adding tensorflow. to the starting, cheers mate