Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anaconda install of Tensorflow missing 'audio_ops' from contrib framework

Tags:

tensorflow

I'm trying to follow along the Audio Recognition Network tutorial.

I've created an Anaconda environment with python 3.6 and followed the install instruction accordingly for installing the GPU whl.

I can run the 'hello world' TF example.

When I go to run 'train.py' in the Audio Recognition Network tutorial/example, I get:

Traceback (most recent call last):
  File "train.py", line 79, in <module>
    import input_data
  File "/home/philglau/speech_commands/input_data.py", line 35, in <module>
    from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
ImportError: cannot import name 'audio_ops'

The code in the tutorial that fails is:

from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio

I then backed up that chain until I could import some part of it:

import tensorflow.contrib.framework as test ==> works
import tensorflow.contrib.framework.python as test --> fail: 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'tensorflow.contrib.framework' has no attribute 'python'

Not sure where I'm going wrong on my install.

Details:

Ubuntu 16.04
Anaconda env with python 3.6
Followed the 'anaconda' instruction on the TF install page. (GPU version)

I also tried using a python 2.7 env for anaconda but got the same results.

like image 845
Phil Glau Avatar asked Aug 30 '17 05:08

Phil Glau


People also ask

When was TensorFlow contrib removed?

contrib was removed in version 1.14 or 1.15.

What is TF contrib?

TensorFlow's high-level machine learning API (tf. contrib. learn) makes it easy to configure, train, and evaluate a variety of machine learning models. In this quickstart tutorial, you'll use tf. contrib.


1 Answers

It looks like they're releasing the audio_ops modules in version 1.4 (https://github.com/tensorflow/tensorflow/issues/11339#issuecomment-327879009).

Until v1.4 is released, an easy way around this is to install the nightly tensorflow build

pip install tf-nightly

or with the docker image linked in the issue comment.

like image 153
Cameron Avatar answered Oct 05 '22 04:10

Cameron