Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Cannot import minio.error ResponseError #472

Closed
HYDesmondLiu opened this issue Feb 26, 2021 · 7 comments
Closed

Cannot import minio.error ResponseError #472

HYDesmondLiu opened this issue Feb 26, 2021 · 7 comments

Comments

@HYDesmondLiu
Copy link

HYDesmondLiu commented Feb 26, 2021

Hi experts,
I just refer to the tutorials and found this error running it.
Do I must have minio working to use Coach RL? May I know how do I solve this?
Is it only for visualization? What lines could I remove to make it work?

Environment:

  • Ubuntu 18.04
  • minio==7.0.2
  • rl-coach==1.0.1
Traceback (most recent call last):
  File "batch_rl.py", line 13, in <module>
    from rl_coach.agents.ddqn_bcq_agent import DDQNBCQAgentParameters, KNNParameters
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/agents/ddqn_bcq_agent.py", line 25, in <module>
    from rl_coach.graph_managers.batch_rl_graph_manager import BatchRLGraphManager
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/graph_managers/batch_rl_graph_manager.py", line 26, in <module>
    from rl_coach.graph_managers.graph_manager import ScheduleParameters
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/graph_managers/graph_manager.py", line 35, in <module>
    from rl_coach.data_stores.data_store_impl import get_data_store as data_store_creator
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/data_stores/data_store_impl.py", line 19, in <module>
    from rl_coach.data_stores.s3_data_store import S3DataStore, S3DataStoreParameters
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/data_stores/s3_data_store.py", line 21, in <module>
    from minio.error import ResponseError
ImportError: cannot import name 'ResponseError'

from minio.error import ResponseError
ImportError: cannot import name 'ResponseError'
@HYDesmondLiu
Copy link
Author

It seems like minio has changed their class name from 'ResponseError' to 'InvalidResponseError'.
I have to manually modify the ones in s3_data_store.py......

@HYDesmondLiu
Copy link
Author

HYDesmondLiu commented Feb 26, 2021

OK, then now I got this.
Is it that you developed code based on TenforFlow 1.X version?
AFAIK, Tensorflow modified a lot of APIs migrating from V1 to V2.

Traceback (most recent call last):
  File "batch_rl.py", line 87, in <module>
    graph_manager.create_graph(task_parameters)
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/graph_managers/graph_manager.py", line 148, in create_graph
    self.level_managers, self.environments = self._create_graph(task_parameters)
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/graph_managers/batch_rl_graph_manager.py", line 152, in _create_graph
    spaces_definition=self.spaces_definition)
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/level_manager.py", line 91, in __init__
    self.build(spaces_definition)
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/level_manager.py", line 165, in build
    [agent.set_environment_parameters(spaces) for agent in self.agents.values()]
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/level_manager.py", line 165, in <listcomp>
    [agent.set_environment_parameters(spaces) for agent in self.agents.values()]
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/agents/agent.py", line 335, in set_environment_parameters
    self.init_environment_dependent_modules()
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/agents/value_optimization_agent.py", line 46, in init_environment_dependent_modules
    super().init_environment_dependent_modules()
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/agents/agent.py", line 380, in init_environment_dependent_modules
    self.networks = self.create_networks()
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/agents/agent.py", line 353, in create_networks
    worker_device=self.worker_device)
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/architectures/network_wrapper.py", line 86, in __init__
    network_is_trainable=True)
  File "/home/hsinyu/hyliu_Python/lib/python3.6/site-packages/rl_coach/architectures/tensorflow_components/general_network.py", line 71, in construct
    with tf.variable_scope(variable_scope, auxiliary_name_scope=True) as vs:
AttributeError: module 'tensorflow' has no attribute 'variable_scope'

@HYDesmondLiu
Copy link
Author

HYDesmondLiu commented Feb 27, 2021

Alright I have tried to replace all the v2 behavior with v1 but it is exhaustive.
Would you please let me know if using the following works or not or I need to downgrade my TensorFlow version?

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

@HYDesmondLiu
Copy link
Author

OK, I finally found the solution:

  1. Install TensorFlow with 1.7.0 (<1.7.0 the hub is not working)
  2. modify the minio class name.

Please make quick fix if possible to benefit others so they do not need to suffer like me.

@HYDesmondLiu
Copy link
Author

Is anyone still maintaining this Github page? Just curious......

@mail2surie
Copy link

Hi,
I am facing the same issue.
seems like the issue is not yet fixed.
may I know what changes did you do to overcome this issue..

@smart-patrol
Copy link

smart-patrol commented Oct 29, 2021

I've gotten the same error. Possibly related to how coach is only supported for Ubuntu 16? Running 18 as well.

Edit:

I got it to work.

I went back and used Ubuntu 16 with Python 3.5. I followed the install steps as listed and then also ran the installs here.

Real shame that this lib went into maintenance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants