我正在尝试按照音频识别网络教程.
我用python 3.6创建了一个Anaconda环境,然后按照安装说明安装GPU.
我可以运行"hello world"TF示例.
当我在音频识别网络教程/示例中运行'train.py'时,我得到:
Traceback (most recent call last): File "train.py", line 79, inimport input_data File "/home/philglau/speech_commands/input_data.py", line 35, in from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio ImportError: cannot import name 'audio_ops'
失败的教程中的代码是:
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
然后我备份了那个链,直到我可以导入它的一部分:
import tensorflow.contrib.framework as test ==> works import tensorflow.contrib.framework.python as test --> fail: Traceback (most recent call last): File "", line 1, in AttributeError: module 'tensorflow.contrib.framework' has no attribute 'python'
不确定我的安装在哪里出错了.
细节:
Ubuntu 16.04 Anaconda env with python 3.6 Followed the 'anaconda' instruction on the TF install page. (GPU version)
我也尝试使用python 2.7 env for anaconda但得到了相同的结果.
看起来他们正在发布版本1.4中的audio_ops模块(https://github.com/tensorflow/tensorflow/issues/11339#issuecomment-327879009).
在v1.4发布之前,一个简单的方法是安装nightly tensorflow构建
pip install tf-nightly
或者在问题评论中链接的docker镜像.