devicehive / devicehive-audio-analysis

Apache License 2.0
196 stars 80 forks source link

Can't run project #4

Open IronBCC opened 6 years ago

IronBCC commented 6 years ago

For both variants (from wav and mic recording) that I try - same error: Traceback (most recent call last): File "parse_file.py", line 39, in <module> process_file(**vars(args)) File "parse_file.py", line 31, in process_file with WavProcessor() as proc: File "/mnt/Data/project/devicehive-audio-analysis/audio/processor.py", line 45, in __init__ self._init_youtube() File "/mnt/Data/project/devicehive-audio-analysis/audio/processor.py", line 74, in _init_youtube youtube8m.model.load_model(sess, params.YOUTUBE_CHECKPOINT_FILE) File "/mnt/Data/project/devicehive-audio-analysis/audio/utils/youtube8m/model.py", line 43, in load_model set_up_init_ops(tf.get_collection_ref(tf.GraphKeys.LOCAL_VARIABLES)) File "/mnt/Data/project/devicehive-audio-analysis/audio/utils/youtube8m/model.py", line 26, in set_up_init_ops if "train_input" in variable.name: AttributeError: 'str' object has no attribute 'name' Model was downloaded from your link.

Nikolay-Kha commented 6 years ago

What is your Python version? python --version You could also try to use python3 (do not forget to install dependencies with pip3).

lishuchao012 commented 6 years ago

I meet the same problem, python2, python3 both not work

igor-panteleev commented 6 years ago

Hi, Can you share your pip freeze output?

lishuchao012 commented 6 years ago

I have solved the problem imported by pycharm, maybe some dependencies not install

isaacaddis commented 6 years ago

Same here, but I have all dependencies installed as per the requirements.txt

isaacaddis commented 6 years ago

Ok, so to anyone having this problem, make sure to specify your mic usinginput_device_index=x on your self.in_stream() and self.out_stream() functions in device.py.

To find the ID of your input device, run (note, run sudo pip install sounddevice first):

import sounddevice
print(sounddevice.query_devices())

where you can look through all sound devices attached to your computer.

Edit: So for example, self.in_stream = self.pa.open(format=pyaudio.paInt16, channels=1, input_device_index = 3, rate=44100, input=True)

isaacaddis commented 6 years ago

This removed the initial problem I had, and it actually runs perfectly on my laptop running Linux Mint, but when I try to port the code to a Raspberry Pi 3 (which has all packages correctly installed with reference to the requirements.txt), I'm always given the -9981 Buffer Overffow error.

Is it impossible to run such an application on the limited hardware of the Raspberry PI? By the way thank you very much for publishing a really cool use of Tensorflow for audio analysis.