Giter Site home page Giter Site logo

Comments (8)

lissyx avatar lissyx commented on May 22, 2024 1

Just curious, why is it that the filename would affect whether or not the program works?

It makes sense, the from deepspeech import Model would consider deepspeech module to be your deepspeech.py :-)

from deepspeech-examples.

reuben avatar reuben commented on May 22, 2024

from deepspeech-examples.

Mchar7 avatar Mchar7 commented on May 22, 2024

Thanks for the help. I hope this isn't too verbose, but here is the steps I took:

[MYUSERNAME@MYPC MYPROJECTFOLDER]$ virtualenv -p python3 $HOME/tmp/deepspeech-venv/ Running virtualenv with interpreter /usr/bin/python3 Using base prefix '/usr' New python executable in /home/MYUSERNAME/tmp/deepspeech-venv/bin/python3 Not overwriting existing python script /home/MYUSERNAME/tmp/deepspeech-venv/bin/python (you must use /home/MYUSERNAME/tmp/deepspeech-venv/bin/python3) Installing setuptools, pip, wheel... done.

[MYUSERNAME@MYPC MYPROJECTFOLDER]$ source $HOME/tmp/deepspeech-venv/bin/activate

(deepspeech-venv) [MYUSERNAME@MYPC MYPROJECTFOLDER]$ sudo pip3 install --force deepspeech Collecting deepspeech Using cached https://files.pythonhosted.org/packages/f7/ad/cde815d6b3745f506184c095a8021ebefddc04981d61c780d04ef1224024/deepspeech-0.6.0-cp38-cp38-manylinux1_x86_64.whl Collecting numpy>=1.17.3 Using cached https://files.pythonhosted.org/packages/d7/6a/3fed132c846d1e47963f30376cc041e9dd586d286d931055ad06ff65c6c7/numpy-1.17.4-cp38-cp38-manylinux1_x86_64.whl Installing collected packages: numpy, deepspeech Found existing installation: numpy 1.17.4 Uninstalling numpy-1.17.4: Successfully uninstalled numpy-1.17.4 Found existing installation: deepspeech 0.6.0 Uninstalling deepspeech-0.6.0: Successfully uninstalled deepspeech-0.6.0 Successfully installed deepspeech-0.6.0 numpy-1.17.4

(deepspeech-venv) [MYUSERNAME@MYPC MYPROJECTFOLDER]$ deepspeech --model deepspeech-0.6.0-models/output_graph.pbmm --lm deepspeech-0.6.0-models/lm.binary --trie deepspeech-0.6.0-models/trie --audio audio/2830-3980-0043.wav Loading model from file deepspeech-0.6.0-models/output_graph.pbmm TensorFlow: v1.14.0-21-ge77504a DeepSpeech: v0.6.0-0-g6d43e21 Loaded model in 0.0658s. Loading language model from files deepspeech-0.6.0-models/lm.binary deepspeech-0.6.0-models/trie Loaded language model in 0.000287s. Running inference. experience proof less Inference took 2.650s for 1.975s audio file.

(deepspeech-venv) [MYUSERNAME@MYPC MYPROJECTFOLDER]$ python3 deepspeech.py --model deepspeech-0.6.0-models/output_graph.pbmm --lm deepspeech-0.6.0-models/lm.binary --trie deepspeech-0.6.0-models/trie Initializing model... INFO:root:ARGS.model: deepspeech-0.6.0-models/output_graph.pbmm **Traceback (most recent call last): File "deepspeech.py", line 237, in <module> main(ARGS) File "deepspeech.py", line 164, in main model = deepspeech.Model(ARGS.model, ARGS.beam_width) AttributeError: module 'deepspeech' has no attribute 'Model'**

As you can see, it worked fine when using the DeepSpeech example from the main repo's README, but when I executed deepspeech.py (which is an exact copy of mic_vad_streaming.py) it gave the same error as before.

P.S.: I might be AFK for a little bit before I get to work on it again.

from deepspeech-examples.

lissyx avatar lissyx commented on May 22, 2024

You are setting up a virtual env and still use sudo to run pip. This can only lead to mess and inconsistent setup

from deepspeech-examples.

Mchar7 avatar Mchar7 commented on May 22, 2024

You are setting up a virtual env and still use sudo to run pip. This can only lead to mess and inconsistent setup

Good point, I didn't even consider that.
I created a different venv, installed all the needed libraries using pip without sudo and ran it again but I keep getting the same error.

from deepspeech-examples.

lissyx avatar lissyx commented on May 22, 2024

You are setting up a virtual env and still use sudo to run pip. This can only lead to mess and inconsistent setup

Good point, I didn't even consider that.
I created a different venv, installed all the needed libraries using pip without sudo and ran it again but I keep getting the same error.

Can you also ensure the python3 command you issue does properly load the expected python from virtualenv ? Can you verify pip list as well ?

That's really really weird ...

from deepspeech-examples.

lissyx avatar lissyx commented on May 22, 2024

(deepspeech-venv) [MYUSERNAME@MYPC MYPROJECTFOLDER]$ python3 deepspeech.py --model deepspeech-0.6.0-models/output_graph.pbmm --lm deepspeech-0.6.0-models/lm.binary --trie deepspeech-0.6.0-models/trie Initializing model... INFO:root:ARGS.model: deepspeech-0.6.0-models/output_graph.pbmm Traceback (most recent call last): File "deepspeech.py", line 237, in main(ARGS) File "deepspeech.py", line 164, in main model = deepspeech.Model(ARGS.model, ARGS.beam_width) AttributeError: module 'deepspeech' has no attribute 'Model'

WAIT WAIT WAIT

What is this deepspeech.py ? Where does it comes from ? That's not in any of the examples as much as I can see.

from deepspeech-examples.

Mchar7 avatar Mchar7 commented on May 22, 2024

(deepspeech-venv) [MYUSERNAME@MYPC MYPROJECTFOLDER]$ python3 deepspeech.py --model deepspeech-0.6.0-models/output_graph.pbmm --lm deepspeech-0.6.0-models/lm.binary --trie deepspeech-0.6.0-models/trie Initializing model... INFO:root:ARGS.model: deepspeech-0.6.0-models/output_graph.pbmm Traceback (most recent call last): File "deepspeech.py", line 237, in main(ARGS) File "deepspeech.py", line 164, in main model = deepspeech.Model(ARGS.model, ARGS.beam_width) AttributeError: module 'deepspeech' has no attribute 'Model'

WAIT WAIT WAIT

What is this deepspeech.py ? Where does it comes from ? That's not in any of the examples as much as I can see.

It's working now. Thanks for your help @lissyx and @reuben. I named my testing file deepspeech.py just to test it. I didn't know that you couldn't name a python file the same as a library being used in it. If I name it to anything else, it works.

Just curious, why is it that the filename would affect whether or not the program works?

from deepspeech-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.