导入tensorflow会导致python引发错误并运行另一个脚本

时间:2019-04-21 22:55:08

标签: python tensorflow tkinter keras

我当时正在使用一个带有tensorflow和Tkinter的简单项目,现在tensorflow和keras不再工作,并且我遇到了奇怪的错误,并且一个旧的已删除代码会自动运行?

我删除了继续运行的脚本,并尝试重新安装tensorflow,但是我仍然遇到相同的错误,这是stacktrace

  import tensorflow as tf

  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 81, in <module>
    from tensorflow.python import keras
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\python\keras\__init__.py", line 26, in <module>
    from tensorflow.python.keras import activations
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\python\keras\activations\__init__.py", line 22, in <module>
    from tensorflow.python.keras._impl.keras.activations import elu
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\python\keras\_impl\keras\__init__.py", line 35, in <module>
    from tensorflow.python.keras._impl.keras import preprocessing
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\python\keras\_impl\keras\preprocessing\__init__.py", line 21, in <module>
    from tensorflow.python.keras._impl.keras.preprocessing import image
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\tensorflow\python\keras\_impl\keras\preprocessing\image.py", line 45, in <module>
    import scipy.ndimage as ndi
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\scipy\ndimage\__init__.py", line 161, in <module>
    from .filters import *
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\scipy\ndimage\filters.py", line 37, in <module>
    from scipy.misc import doccer
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\scipy\misc\__init__.py", line 65, in <module>
    from .pilutil import *
  File "C:\Users\Ce PC\Anaconda3\lib\site-packages\scipy\misc\pilutil.py", line 26, in <module>
    Image.frombytes = Image.fromstring
AttributeError: module 'PIL.Image' has no attribute 'fromstring'

0 个答案:

没有答案