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

assert float(tf.__version__[:3]) >= 2.3 triggers because actual version is > 2.10 #25

Open
MG-EuS opened this issue Sep 22, 2023 · 3 comments · May be fixed by #26
Open

assert float(tf.__version__[:3]) >= 2.3 triggers because actual version is > 2.10 #25

MG-EuS opened this issue Sep 22, 2023 · 3 comments · May be fixed by #26
Labels

Comments

@MG-EuS
Copy link

MG-EuS commented Sep 22, 2023

Description

In retrain_classification_ptq_tf2.ipynb, there is a check assert float(tf.__version__[:3]) >= 2.3 that should check whether the used tensorflow version is at least 2.3 or higher. Now colab uses 2.13 as its standard. That is higher than 2.3 but the assert triggers, because it makes 2.13 seem like 2.1. And also the float number 2.13 is smaller than 2.3. But as a version number it is higher.

Click to expand!

Issue Type

Bug

Operating System

No response

Coral Device

No response

Other Devices

No response

Programming Language

No response

Relevant Log Output

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-13-b98ebe4840c4> in <cell line: 1>()
----> 1 assert float(tf.__version__[:3]) >= 2.3

AssertionError:
@google-coral-bot google-coral-bot bot added the type:bug Bug label Sep 22, 2023
@ahsanfi
Copy link

ahsanfi commented Oct 31, 2023

Description

In retrain_classification_ptq_tf2.ipynb, there is a check assert float(tf.__version__[:3]) >= 2.3 that should check whether the used tensorflow version is at least 2.3 or higher. Now colab uses 2.13 as its standard. That is higher than 2.3 but the assert triggers, because it makes 2.13 seem like 2.1. And also the float number 2.13 is smaller than 2.3. But as a version number it is higher.

Click to expand!

Issue Type

Bug

Operating System

No response

Coral Device

No response

Other Devices

No response

Programming Language

No response

Relevant Log Output

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-13-b98ebe4840c4> in <cell line: 1>()
----> 1 assert float(tf.__version__[:3]) >= 2.3

AssertionError:

How to solve it for keep it running?

@friedensfurz
Copy link

Version numbers as floats are always a bad idea. Something like this should fix it:

from packaging import version

assert version.parse(tf.__version__) >= version.parse("2.3"), "TensorFlow version is not >= 2.3"

Alternatively if you prefer less dependencies:

version_numbers = tuple(map(int, tf.__version__.split('.')))
assert version_numbers >= (2, 3, 0), "TensorFlow version is not >= 2.3"

@friedensfurz friedensfurz linked a pull request Nov 5, 2023 that will close this issue
@ahsanfi
Copy link

ahsanfi commented Nov 5, 2023

Version numbers as floats are always a bad idea. Something like this should fix it:

from packaging import version

assert version.parse(tf.__version__) >= version.parse("2.3"), "TensorFlow version is not >= 2.3"

Alternatively if you prefer less dependencies:

version_numbers = tuple(map(int, tf.__version__.split('.')))
assert version_numbers >= (2, 3, 0), "TensorFlow version is not >= 2.3"

Hello, I have already managed to create a model. Now, how to run the model for live classification using web camera? I have following this tutorial https://coral.ai/docs/dev-board/camera/#view-with-a-streaming-server but the model cannot run. Thanks

WhatsApp Image 2023-11-02 at 00 57 27_93fe2b1d
This is the error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants