我已经安装了 PIL,但我不断收到以下错误消息:
'module' object has no attribute 'imread'.
我浏览了所有关于 的帖子imread
,但没有运气。有什么想法吗?
Danys-MacBook-Pro:~ danymeneses$ python
/Users/danymeneses/Desktop/autoencoder/main.py --dataset
/Users/danymeneses/Desktop/autoencoder/dataseti --is_train True
{'batch_size': 12,
'beta1': 0.5,
'checkpoint_dir': 'checkpoint',
'dataset': '/Users/danymeneses/Desktop/autoencoder/dataseti',
'epoch': 5,
'image_size': 108,
'is_crop': False,
'is_run': False,
'is_train': True,
'learning_rate': 0.0002,
'noise': 0.5,
'output_dir': 'output',
'sample_dir': 'samples',
'train_size': inf}
WARNING:tensorflow:Passing a `GraphDef` to the SummaryWriter is deprecated.
Pass a `Graph` object instead, such as `sess.graph`.
Traceback (most recent call last):
File "/Users/danymeneses/Desktop/autoencoder/main.py", line 94, in <module>
tf.app.run()
File "/Library/Python/2.7/site-packages/tensorflow/python/platform/app.py",
line 30, in run
sys.exit(main(sys.argv))
File "/Users/danymeneses/Desktop/autoencoder/main.py", line 75, in main
autoencoder.train(FLAGS)
File "/Users/danymeneses/Desktop/autoencoder/model.py", line 186, in train
sample = [get_image(sample_file, self.image_size, is_crop=self.is_crop) for
sample_file in sample_files]
File "/Users/danymeneses/Desktop/autoencoder/utils.py", line 23, in get_image
return transform(imread(image_path), image_size, is_crop)
File "/Users/danymeneses/Desktop/autoencoder/utils.py", line 38, in imread
return scipy.misc.imread(path).astype(np.float)
AttributeError: 'module' object has no attribute 'imread'