Skip to content

Conversation

@W-Alphonse
Copy link

@W-Alphonse W-Alphonse commented Oct 15, 2020

  • Set up requirements.txt(pip), therefore I'm using TensorFlow-2.3.0.
  • Use the new training model "model_weights_tf2-20200912_173814.h5" compatible with TensorFlow-2.x
  • Update setup.py in order to be distribution ready to upload to Pypi:
    -- python3 setup.py sdist bdist_wheel # Generate a distribution
    -- twine upload dist/* # Upload the distribution

"""Release GPU memory."""
self._model = None

if __name__ == '__main__' :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to execute the file but provide the methods: people would import the package and use the methods.

So we can remove this part.

#
# NB_2:
# https://stackoverflow.com/questions/63277123/what-is-use-feature-2020-resolver-error-message-with-jupyter-installation-on
# We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you generate it using pip freeze? I think some of the packages are used in the microfaune/microfaune repo but not in the package so we'll not include them.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@W-Alphonse W-Alphonse changed the title Requirements.txt using TensorFlow-2.3.0 + Use a training model TF-2.x compatible Requirements.txt using TensorFlow-2.3.0 + Use a training model TF-2.x compatible + Let setup.py be distribution aware Oct 22, 2020
* Run the commands<br/>
Generate the distribution `python3 setup.py sdist bdist_wheel`<br/>
Upload the distribution `twine upload dist/*`

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to keep the readme for users of the package so no need to explain how to generate a distribution? What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually if we keep "how to generate the distribution", this would be helpful for the team members of this season and the next ones.
Just notice that in order to be able to perform the real upload, we should already have knowledge of the SECRETS that are private, so there no risk to keep things as they are unless you identified other issues with that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, nice!

# detector = RNNDetector()
# global_score, local_score = detector.predict_on_wav(os.path.abspath(os.path.join(os.path.dirname(__file__), "media/SWIFT_20190723_050006.wav"))) # NB: Check that loaded wav file actually exists on your disk
# print(f"Golbal score: {global_score} - Localscore: {local_score}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to avoid commented code.

# validator = RNNDetectorValidator(detector)
# # metrics = validator.computeMetricsAgainstAnnotatedFile( os.path.abspath(os.path.join(os.path.dirname(__file__), "media-annotation/SWIFT_20000101_022052.json")) )
# metrics = validator.computeMetricsAgainstAnnotatedDirectory( os.path.abspath(os.path.join(os.path.dirname(__file__), "media-annotation")) )
# print(f'Total METRICS : {metrics}') No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the validation could be outside of the package for now. We can work on this in https://github.com/microfaune/microfaune

# 3 - Check that the last index did't exceed the prediction size
if negative_tuples_ndexes[-1][0] > len(predictions) - 1 :
negative_tuples_ndexes.pop()
return negative_tuples_ndexes No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the previous comment: let's put validation in https://github.com/microfaune/microfaune

#
# NB_2:
# https://stackoverflow.com/questions/63277123/what-is-use-feature-2020-resolver-error-message-with-jupyter-installation-on
# We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

2 participants