2017-03-29 1 views
0

내가 PIL을 설치 한 어떤 속성 'imread을'이 없다, 그러나 나는 다음과 같은 오류 메시지가 계속 : 나는 imread에 관한 모든 게시물 겪었지만, 운이 없었을'모듈'개체가

'module' object has no attribute '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' 
+1

가능한 [scipy.misc 모듈에 imread가없는 속성이 있습니까?] (http://stackoverflow.com/questions/15345790/scipy-misc-module-has-no-attribute-imread) – rayryeng

+0

사본에 제시된대로 PIL 위에 베개를 설치하십시오. – rayryeng

+0

'misc '을 어떻게 가져 왔습니까? 올바른 방법은'scipy import misc'입니다. – hpaulj

답변

1

답장 보내 주셔서 감사합니다. 내가 파이썬 이상의 버전이 설치되어 있다고 통지를하지 않았다, 그래서 난 그냥 같이 갔다 : 나는 내 문제를 해결

python2.7 /Users/danymeneses/Desktop/autoencoder/main.py --dataset 
/Users/danymeneses/Desktop/autoencoder/datasetii --is_train True 

설치 핍 때문에, 내가 해결 내 문제를 사용하고 있었다 파이썬의 버전을 지정 베개는 물론 Python의 모든 버전에 베개를 설치하지 않았습니다.

다시 한 번 감사드립니다.

0

위에서 지정한 내용을 적용 할 필요는 없지만 같은 컴퓨터에서 실행중인 다른 버전이 문제를 일으킬 수 있다는 것을 알고 있으면 문제를 해결하는 데 도움이되었습니다. 예, 나는 Jupyter 노트북에 커널 버전의 값을 변경하여 커널 버전이 파이썬 3이고 다시 시작했다는 사실을 알려야했습니다.