tensorflow / tensorflow/model-optimization

Unable to get tfmot version from API

Open
#594 2 comments 1 reaction 1 assignee View on GitHub

@daverim is already working on this.

Since Apr 18, 2021.

bug
Dominant language
Python
Stars
1.6k
Forks
349
Avg merge
3d 2h
Merged PRs (30d)
1

Description

Describe the bug
I'm unable to get the tfmot version from the API. I can get the version by using pip list, but I would like to get the version using the API. The version variable is defined in the following file (see link), but somehow it does not work. https://github.com/tensorflow/model-optimization/blob/master/tensorflow_model_optimization/python/core/version.py

System information
TensorFlow version (installed from source or binary): 2.3.0
TensorFlow Model Optimization version (installed from source or binary): 0.5.0
Python version: 3.6.9

Describe the expected behavior
tfmot.__version__ should return the tfmot version instead of an error.

Describe the current behavior
Error message:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    print('TensorFlow Model Optimization version: '+tfmot.__version__)
AttributeError: module 'tensorflow_model_optimization' has no attribute '__version__'

Code to reproduce the issue

import tensorflow as tf
import tensorflow_model_optimization as tfmot

# Print TensorFlow info
print('TensorFlow version: '+tf.__version__)
print('TensorFlow commit (after -g): '+tf.__git_version__)
print('Keras version: '+tf.keras.__version__)
print('TensorFlow Model Optimization version: '+tfmot.__version__)

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.