Skip to content

Conversation

petrkaderabek
Copy link

Description

Dict union operator d1 | d2 was replaced by { **d1, **d2 }. The repo should be compatible with Python 3.8 but the dict union operator | is available in Python 3.9 and newer.

Incompatibility with Python 3.8 is unlucky, because the newest standard Tensorflow Docker images available from https://hub.docker.com/r/tensorflow/tensorflow/tags have Python version 3.8. The following error occurs:

TypeError: in user code:

    File "/usr/local/lib/python3.8/dist-packages/official/core/base_trainer.py", line 442, in eval_step  *
        return passthrough_logs | logs

    TypeError: unsupported operand type(s) for |: 'dict' and 'dict'

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Tests

I ran my code incl. the change and the previous error no longer occurs.

Test Configuration:
Docker image tensorflow/tensorflow:2.12.0-gpu-jupyter
Ubuntu 20.04
Nvidia 1080ti

Checklist

…olution available in Python 3.8, which is among the supported versions.
@laxmareddyp laxmareddyp added the models:official models that come under official repository label May 31, 2023
@laxmareddyp laxmareddyp added the ready to pull ready to pull (create internal pr review and merge automatically) label Jul 26, 2023
copybara-service bot pushed a commit that referenced this pull request Jan 12, 2024
copybara-service bot pushed a commit that referenced this pull request Jan 12, 2024
@laxmareddyp
Copy link
Collaborator

closing this PR as changes are pushed through internal CL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
models:official models that come under official repository ready to pull ready to pull (create internal pr review and merge automatically)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants