1

Trying to import DQNAgent like this

from rl.agents.dqn import DQNAgent

I get the following error:

cannot import name '__version__' from 'tensorflow.keras'

The installed versions are:

Tensorflow: 2.13.0, Keras: 2.13.1, Keras-rl2: 1.0.5

I am using Anaconda and Jupyter Notebook.

How can I fix this?

EDIT

If that helps to resolve the issue, this import

import tensorflow
from tensorflow import keras

print(keras.__version__)

causes

module 'tensorflow.keras' has no attribute '__version__'
scopchanov
  • 7,966
  • 10
  • 40
  • 68

1 Answers1

0

In rl/callbacks.py change from tensorflow.keras to from keras import __version__. that should do the trick.