ubuntuでpython2.6でプログラムしていますが
あるフォルダで
$pythonのあと
import keras
をおこなうとこのようなメッセージが出力されます
Using TensorFlow backend.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/keras/init.py", line 3, in <module>
from . import utils
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/keras/utils/init.py", line 6, in <module>
from . import conv_utils
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in <module>
from .. import backend as K
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/keras/backend/init.py", line 1, in <module>
from .load_backend import epsilon
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/keras/backend/load_backend.py", line 90, in <module>
from .tensorflow_backend import *
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 5, in <module>
import tensorflow as tf
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/tensorflow/init.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/tensorflow/python/init.py", line 63, in <module>
from tensorflow.python.framework.framework_lib import * # pylint: disable=redefined-builtin
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/tensorflow/python/framework/framework_lib.py", line 25, in <module>
from tensorflow.python.framework.ops import Graph
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 54, in <module>
from tensorflow.python.platform import app
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 23, in <module>
from absl.app import run as _run
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/venv/lib/python3.6/site-packages/absl/app.py", line 35, in <module>
import pdb
File "/usr/local/lib/python3.6/pdb.py", line 73, in <module>
import cmd
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/cmd.py", line 3, in <module>
from SER import Train, Predict
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/SER.py", line 6, in <module>
from DNN_Model import LSTM_Model
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/DNN_Model.py", line 5, in <module>
from keras import Sequential
ImportError: cannot import name 'Sequential'
しかし
他のフォルダでするとエラーなく成功して何も出力しません。
なぜ?
そもそもこのエラーを見るとなぜかその場所のファイルを読んでいます。
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/cmd.py", line 3, in <module>
from SER import Train, Predict
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/SER.py", line 6, in <module>
from DNN_Model import LSTM_Model
File "/home/kokawa2003/work/Speech-Emotion-Recognition_v2/DNN_Model.py", line 5, in <module>
こことかです。
そしてこのエラーは cmd.pyを削除すると消えます。
なぜimportしただけでcmd.pyを読んでいるのかから全くわかりません。
お教えいただければ幸いです
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/31 13:59