hill-a / stable-baselines

A fork of OpenAI Baselines, implementations of reinforcement learning algorithms
http://stable-baselines.readthedocs.io/
MIT License
4.16k stars 725 forks source link

import stable-baselines [Question] #1144

Closed MariaPiaGelos closed 2 years ago

MariaPiaGelos commented 2 years ago

I got this error when i try to import stable-baselines, do you know why this is happening ?

i'm using tensorflow 1.13.1 , python 3.7 and stable-baselines 2.10.2

Thank!!


  File "train.py", line 11, in <module>
    from stable_baselines.common import set_global_seeds
  File "/home/pi/env/lib/python3.7/site-packages/stable_baselines/__init__.py", line 4, in <module>
    from stable_baselines.a2c import A2C
  File "/home/pi/env/lib/python3.7/site-packages/stable_baselines/a2c/__init__.py", line 1, in <module>
    from stable_baselines.a2c.a2c import A2C
  File "/home/pi/env/lib/python3.7/site-packages/stable_baselines/a2c/a2c.py", line 5, in <module>
    import tensorflow as tf
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow/__init__.py", line 98, in <module>
    from tensorflow_core import *
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_core/__init__.py", line 35, in <module>
    from tensorflow._api.v1 import compat
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_core/_api/v1/compat/__init__.py", line 21, in <module>
    from tensorflow._api.v1.compat import v1
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_core/_api/v1/compat/v1/__init__.py", line 652, in <module>
    from tensorflow_estimator.python.estimator.api._v1 import estimator
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/__init__.py", line 8, in <module>
    from tensorflow_estimator._api.v1 import estimator
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/_api/v1/estimator/__init__.py", line 8, in <module>
    from tensorflow_estimator._api.v1.estimator import experimental
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/_api/v1/estimator/experimental/__init__.py", line 8, in <module>
    from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/__init__.py", line 25, in <module>
    import tensorflow_estimator.python.estimator.estimator_lib
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator_lib.py", line 53, in <module>
    from tensorflow_estimator.python.estimator.inputs import inputs
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/inputs/inputs.py", line 22, in <module>
    from tensorflow_estimator.python.estimator.inputs.numpy_io import numpy_input_fn
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/inputs/numpy_io.py", line 26, in <module>
    from tensorflow_estimator.python.estimator.inputs.queues import feeding_functions
  File "/home/pi/env/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/inputs/queues/feeding_functions.py", line 40, in <module>
    import pandas as pd
  File "/usr/lib/python3/dist-packages/pandas/__init__.py", line 13, in <module>
    __import__(dependency)
ValueError: source code string cannot contain null bytes
Miffyli commented 2 years ago

Hey. Seems like this error is coming from tensorflow, not stable-baselines, so we can not give much tips here. Best I can recommend is reinstalling tensorflow (or even whole python installation if that does not work).

Alternatively, I recommend moving to stable-baselines3 which is more actively maintained.

Closing as no tech support.