google / google/dopamine

Cartpole colab: "No module named 'tensorflow.contrib'"

Open
#139 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
10.9k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

Hi,

The [cartpole colab](https://colab.research.google.com/github/google/dopamine/blob/master/dopamine/colab/cartpole.ipynb) raises the below import error on the public Python 3 GCE colab backend. Probably a TF1 vs TF2 issue?

```
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
in ()
3 import numpy as np
4 import os
----> 5 from dopamine.discrete_domains import run_experiment
6 from dopamine.colab import utils as colab_utils
7 from absl import flags

2 frames
/usr/local/lib/python3.6/dist-packages/dopamine/discrete_domains/run_experiment.py in ()
23 import time
24
---> 25 from dopamine.agents.dqn import dqn_agent
26 from dopamine.agents.implicit_quantile import implicit_quantile_agent
27 from dopamine.agents.rainbow import rainbow_agent

/usr/local/lib/python3.6/dist-packages/dopamine/agents/dqn/dqn_agent.py in ()
25
26
---> 27 from dopamine.discrete_domains import atari_lib
28 from dopamine.replay_memory import circular_replay_buffer
29 import numpy as np

/usr/local/lib/python3.6/dist-packages/dopamine/discrete_domains/atari_lib.py in ()
52
53 import cv2
---> 54 from tensorflow.contrib import layers as contrib_layers
55 from tensorflow.contrib import slim as contrib_slim
56

ModuleNotFoundError: No module named 'tensorflow.contrib'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------```

Contributor guide

Open the contributing guide

Research direction

Start with dopamine/colab/cartpole.ipynb and reproduce the import failure on the public Python 3 Colab backend. Then inspect dopamine/discrete_domains/atari_lib.py, especially its tensorflow.contrib imports, alongside the notebook's dependency setup. Done means the cartpole Colab imports successfully without the reported ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.