本日、tensorflowでno attribute 'placeholder' エラーが出てしまいました。
このエラーは今回が初めてです。
エラーメッセージの詳細は次の通りです。
AttributeError Traceback (most recent call last)
<ipython-input-9-cfc0729ced87> in <module>()
38
39 # tf Graph input
---> 40 x = tf.placeholder("float", [None, n_input])
41 y = tf.placeholder("float", [None, n_classes])
42
AttributeError: module 'tensorflow' has no attribute 'placeholder'
ちなみに、環境は次の通りです。
CPU:Core-i5
OS:Windows10,64bit
メモリ:4GB
Anaconda3
python35
tensorflow1.0.1
よろしくお願いします。
カレントまたはパスの通ったディレクトリに「tensorflow.py」という自作ファイルがないでしょうか?
自作でそのような名前のファイルはございません。よろしくお願いします。
「print(tf.__file__)」「print(tf.__version__)」の実行結果はどうなりますか?
コメントありがとうございます。やってみた結果は、次のとおりです。---> 38 print(tf.__file__) 39 print(tf.__version__) 40 # tf Graph input AttributeError: module 'tensorflow' has no attribute '__file__'
同じようなエラーメッセージです。これは環境に問題があるような気がします。
すでに解決済みかもしれませんが、ひとまずtensorflowのバージョン上げておいたほうがいいような気がします。
ありがとうございます。
あなたの回答
tips
プレビュー