question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot import CallbackList

See original GitHub issue

Getting the following error while trying to run the sample DQN code after installation of keras-rl.

Example DQN with Keras-rl

File “keras_rl_test.py”, line 8, in <module> from rl.agents.dqn import DQNAgent File "C:\Users\eljed\anaconda3\lib\site-packages\rl\agents_init.py", line 2, in <module> from .dqn import DQNAgent, NAFAgent, ContinuousDQNAgent File “C:\Users\eljed\anaconda3\lib\site-packages\rl\agents\dqn.py”, line 8, in <module> from rl.core import Agent File “C:\Users\eljed\anaconda3\lib\site-packages\rl\core.py”, line 8, in <module> from rl.callbacks import ( File “C:\Users\eljed\anaconda3\lib\site-packages\rl\callbacks.py”, line 12, in <module> from keras.callbacks import Callback as KerasCallback, CallbackList as KerasCallbackList ImportError: cannot import name ‘CallbackList’ from ‘keras.callbacks’ (C:\Users\eljed\anaconda3\lib\site-packages\keras\callbacks.py)_

Please make sure that the boxes below are checked before you submit your issue. If your issue is an implementation question, please ask your question in the Keras-RL Google group or join the Keras-RL Gitter channel and ask there instead of filing a GitHub issue.

Thank you! KerasRL error

  • Check that you are up-to-date with the master branch of Keras-RL. You can update with: pip install git+git://github.com/keras-rl/keras-rl.git --upgrade --no-deps

  • Check that you are up-to-date with the master branch of Keras. You can update with: pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps

  • Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short). If you report an error, please include the error message and the backtrace.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
GGurtnercommented, Jul 9, 2020

Using tf-nightly fixed this particular problem for me: pip install tf-nightly

Of course it can break something else, but it is a temporary fix until the next version of tensorflow.

2reactions
FitMachineLearningcommented, Jun 27, 2020

Thanks @jyounglee . Unfortunately downgrading is not an option here as TF is setup to work with CUDA and CUDNN specific version needed for my project.

Any support for TF 2.2 coming soon?

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot import name 'CallbackList' from 'keras.callbacks'
I am trying to implement DQN to solve RL problem with keras. I use MAC and running this code in an Anaconda Jupyter...
Read more >
tf.keras.callbacks.CallbackList | TensorFlow v2.11.0
Container abstracting a list of callbacks.
Read more >
keras.callbacks — pysparkdl documentation
import tensorflow.compat.v2 as tf import collections import copy import csv import json ... Returns: Instance of CallbackList used to control all Callbacks.
Read more >
Callbacks — Stable Baselines3 0.11.1 documentation
from stable_baselines3.common.callbacks import BaseCallback class ... Create the callback list callback = CallbackList([checkpoint_callback, ...
Read more >
Cannot import CSVLogger from keras.callbacks
from keras.callbacks import CSVLogger ImportError: cannot import name CSVLogger. I then wen into the callback.py , and found out that there was no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found