Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes for compatibility to Python 3.10 #242

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

icarosadero
Copy link

Made minor changes to allow this project to run on most recent versions of TensorFlow and Python 3.10

Type of PR

If your PR fits more than one category, there is a high chance you should submit more than one PR. Please consider this carefully before opening the PR.
Either delete those that do not apply, or add an x between the square brackets like so: - [x]

  • [x ] Bugfix
  • Feature implementation
  • [x ] Refactor of code (without functional changes)
  • Documentation improvements
  • Test improvements

Testing

How can someone reviewing this PR test that it is working properly? Is there appropriate test coverage for this change?

Documentation

Does documentation for this already exist? Are there docstrings on all the public methods you added or modified? Have these been updated?

CLA

To protect you, the project, and those who choose to use Mycroft technologies in systems they build, we ask all contributors to sign a Contributor License Agreement.

This agreement clarifies that you are granting a license to the Mycroft Project to freely use your work. Additionally, it establishes that you retain the ownership of your contributed code and intellectual property. As the owner, you are free to use your code in other work, obtain patents, or do anything else you choose with it.

If you haven't already signed the agreement and been added to our public Contributors repo then please head to https://mycroft.ai/cla to initiate the signing process.

@Shulyaka
Copy link

Thank you!
I hope someone is still around to merge this.
Precise is a great project (and probably the only one that is open source and allow to train custom wake words)

precise/model.py Outdated Show resolved Hide resolved
Co-authored-by: Denis Shulyaka <Shulyaka@gmail.com>
@Shulyaka
Copy link

I also had to replace self.tf.GraphDef() with self.tf.compat.v1.GraphDef() on network_runner.py line 60 and self.tf.Session with self.tf.compat.v1.Session on line 56 of the same file.

```
Exception in thread Thread-1 (_handle_predictions):
Traceback (most recent call last):
  File "/usr/lib64/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/usr/lib64/python3.11/threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "/home/denis/mycroft-precise/runner/precise_runner/runner.py", line 243, in _handle_predictions
    self.on_activation()
  File "/home/denis/mycroft-precise/precise/scripts/listen.py", line 71, in on_activation
    save_audio(nm, self.audio_buffer)
  File "/home/denis/mycroft-precise/precise/util.py", line 72, in save_audio
    wavio.write(filename, save_audio, pr.sample_rate, sampwidth=pr.sample_depth, scale='none')
  File "/home/denis/mycroft-precise/.venv/lib64/python3.11/site-packages/wavio.py", line 441, in write
    raise ValueError('The scale parameter must not be set when the '
ValueError: The scale parameter must not be set when the input is an integer array.  No shifting or scaling is done to integer input values.
```
@Shulyaka
Copy link

@icarosadero I've raised PR icarosadero#1
Please accept it to apply my suggestions to this PR (is for like it).

more updates to support newer tensorflow versions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants