Keras-GAN icon indicating copy to clipboard operation
Keras-GAN copied to clipboard

ImportError: No module named 'data_loader'

Open erwin999888 opened this issue 6 years ago • 3 comments

from future import print_function, division import scipy

from keras.datasets import mnist from keras_contrib.layers.normalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate from keras.layers import BatchNormalization, Activation, ZeroPadding2D from keras.layers.advanced_activations import LeakyReLU from keras.layers.convolutional import UpSampling2D, Conv2D from keras.models import Sequential, Model from keras.optimizers import Adam import datetime import matplotlib.pyplot as plt import sys from data_loader import DataLoader import numpy as np import os

================================================= ImportError Traceback (most recent call last) in () 13 import matplotlib.pyplot as plt 14 import sys ---> 15 from data_loader import DataLoader 16 import numpy as np 17 import os

ImportError: No module named 'data_loader'

erwin999888 avatar Jul 09 '18 16:07 erwin999888

Are you trying to use the pix2pix library? Try creating a file named "__init__.py" in the directory.

jkim- avatar Jul 09 '18 17:07 jkim-

The file data_loader.py should be in the same directory.

miranthajayatilake avatar Jul 12 '18 08:07 miranthajayatilake

It appears you are also working through the (fantastic) Manning series "GANs in Action". Your code appears to be the final section, on CycleGANs. The authors note that the data_loader is provided in their GitHub repo for the chapter. Check out their workbook here: https://github.com/GANs-in-Action/gans-in-action/blob/master/chapter-9/Chapter9_CycleGAN.ipynb

MikhailLenko avatar Jun 23 '20 17:06 MikhailLenko