ImportError: Could not import the Python Imaging Library (PIL) required to load image files on tensorflow

后端 未结 5 2248
独厮守ぢ
独厮守ぢ 2020-12-13 06:23

I am doing a deep learning course on udacity. For the first assignment whenI tried to run the script which is below the problem 1 , I got this error. So I tried to uninstall

5条回答
  •  [愿得一人]
    2020-12-13 06:48

    Install PIL in anaconda, then:

    from PIL import Image
    model.fit_generator(
            train_generator,
            steps_per_epoch=2000 // batch_size,
            epochs=50,
            validation_data=validation_generator,
            validation_steps=800 // batch_size)
    model.save_weights('first_try.h5') 
    
    output will display like: Epoch 1/50
     34/125 [=======>......................] - ETA: 7:23 - loss: 0.7237 - acc: 0.5478 ... comntinue 
    

提交回复
热议问题