GithubHelp home page GithubHelp logo

Comments (10)

Haichao-Zhang avatar Haichao-Zhang commented on August 31, 2024
  1. Which revision (SHA number) are you using? Can you pull the most recent revision (76946fd) and try again? There was a issue introduced in some recent commits which was fixed in yesterday.
  2. Can you make sure the gin is installed correctly? You can run :
    pip install gin-config@git+https://github.com/HorizonRobotics/gin-config.git

from alf.

hnyu avatar hnyu commented on August 31, 2024

This is weird because obviously the conf file is not a .gin file. It shouldn't run line 603 of config_util.py. Did you make any change to any conf file?

from alf.

hnyu avatar hnyu commented on August 31, 2024

This is weird because obviously the conf file is not a .gin file. It shouldn't run line 603 of config_util.py. Did you make any change to any conf file?

Sorry that line will be run regardless of whether the file is .gin or not. Yeah I suggest checking your gin installation. It seems that the gin version is not correct.

Another (worse) solution is to set the environment variable export ALF_USE_GIN=0, basically telling ALF not to run anything related to gin.

from alf.

Mming11 avatar Mming11 commented on August 31, 2024

2023-03-31 11-12-39 的屏幕截图
Thank you! I have solved this problem. But i encounter another problem.

from alf.

Mming11 avatar Mming11 commented on August 31, 2024

I also want to ask if my command is correct... ToT

from alf.

hnyu avatar hnyu commented on August 31, 2024

2023-03-31 11-12-39 的屏幕截图 Thank you! I have solved this problem. But i encounter another problem.

It seems that your "_penv.so" was not correctly built. Which version of ALF are you using? We did fix a bug regarding _penv recently. See this PR 9bb690a#diff-60f61ab7a8d1910d86d9fda2261620314edcae5894d5aaa236b821c7256badd7R59

If your ALF version is new and still can't build _penv.so, check if you have boost installed. boost needs to apt installed as mentioned in the readme. Generally, when installing ALF, if you notice any error message you can post it here.

from alf.

Mming11 avatar Mming11 commented on August 31, 2024

I can run this. But i meet this error.
(wmy_transformer_env) yl-02@yl02:~/alf$ python -m alf.bin.train --conf=/home/yl-02/alf/alf/examples/metadrive/ppg_metadrive_transformer_conf.py --root_dir=/home/yl-02/test
I0331 14:44:16.065391 140103114884288 common.py:1484] Generated a snapshot alf@/home/yl-02/alf
/home/yl-02/anaconda3/envs/wmy_transformer_env/lib/python3.8/site-packages/gym/envs/registration.py:440: UserWarning: WARN: The registry.env_specs property along with EnvSpecTree is deprecated. Please use registry directly as a dictionary instead.
logger.warn(
Successfully registered the following environments: ['MetaDrive-validation-v0', 'MetaDrive-10env-v0', 'MetaDrive-100envs-v0', 'MetaDrive-1000envs-v0', 'SafeMetaDrive-validation-v0', 'SafeMetaDrive-10env-v0', 'SafeMetaDrive-100envs-v0', 'SafeMetaDrive-1000envs-v0', 'MARLTollgate-v0', 'MARLBottleneck-v0', 'MARLRoundabout-v0', 'MARLIntersection-v0', 'MARLParkingLot-v0', 'MARLMetaDrive-v0'].
/home/yl-02/alf/alf/utils/value_ops.py:122: DeprecationWarning: invalid escape sequence \s
"""Computes discounted return for the first T-1 steps.
/home/yl-02/alf/alf/algorithms/td_loss.py:102: DeprecationWarning: invalid escape sequence \g
"""Return the :math:\gamma value for discounting future rewards.
W0331 14:44:16.812323 140103114884288 ppg_metadrive_transformer_conf.py:31] The value of config 'create_environment.num_parallel_environments' has been configured to 12. It is replaced by the new value 36
W0331 14:44:16.812726 140103114884288 ppg_metadrive_transformer_conf.py:210] The value of config 'PPOLoss.entropy_regularization' has been configured to None. It is replaced by the new value 0.005
I0331 14:44:16.813316 140103114884288 fast_parallel_environment.py:133] Spawning all processes.
I0331 14:44:17.221843 140103114884288 fast_parallel_environment.py:144] All processes started.
I0331 14:44:21.781528 140103114884288 policy_trainer.py:525] observation_spec=
{ 'agent_mask': TensorSpec(shape=(16,), dtype=torch.bool),
'agents': TensorSpec(shape=(16, 6, 7), dtype=torch.float32),
'ego': TensorSpec(shape=(138,), dtype=torch.float32),
'map': TensorSpec(shape=(128, 28), dtype=torch.float32),
'map_mask': TensorSpec(shape=(128,), dtype=torch.bool)}
I0331 14:44:21.782012 140103114884288 policy_trainer.py:527] action_spec=
BoundedTensorSpec(shape=(2,), dtype=torch.float32, minimum=array(-1., dtype=float32), maximum=array(1., dtype=float32))
I0331 14:44:21.782315 140103114884288 policy_trainer.py:541] transformed_observation_spec={ 'agent_mask': TensorSpec(shape=(16,), dtype=torch.bool),
'agents': TensorSpec(shape=(16, 6, 7), dtype=torch.float32),
'ego': TensorSpec(shape=(138,), dtype=torch.float32),
'map': TensorSpec(shape=(128, 28), dtype=torch.float32),
'map_mask': TensorSpec(shape=(128,), dtype=torch.bool)}
I0331 14:44:33.196366 140103114884288 rl_algorithm.py:86] Actual replay buffer length is adjusted to 65.
I0331 14:44:33.196463 140103114884288 rl_algorithm.py:240] Set the initial_collect_steps to minimum required value 2340 because whole_replay_buffer_training is on.
E0331 14:44:33.464665 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.520661 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.528075 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.537440 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.543925 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.551518 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.577635 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.634830 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.650705 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.698209 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.709520 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.733242 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.746616 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.797091 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.803851 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.815871 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.822227 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.828225 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.854294 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.863766 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.876917 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.889055 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.894460 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.901757 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.907322 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.914123 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.917498 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.930287 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.937046 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.942549 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.943555 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.968989 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:33.978813 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:34.002743 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:34.003203 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

E0331 14:44:34.013033 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last):
File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker
penv.worker()
TypeError: Object of type 'int' is not an instance of 'buffer'

from alf.

hnyu avatar hnyu commented on August 31, 2024

E0331 14:44:34.013033 140103114884288 process_environment.py:104] Error in environment process: Traceback (most recent call last): File "/home/yl-02/alf/alf/environments/process_environment.py", line 85, in _worker penv.worker() TypeError: Object of type 'int' is not an instance of 'buffer'

OK, this is clearly a bug of penv as I can reproduce it. @emailweixu Can you take a look? @Mming11 For now, you can choose not to use the new fast parallel env by adding these additional lines right after the import lines in the conf file:

from alf.environments import parallel_environment
alf.config('create_environment', parallel_environment_ctor=parallel_environment.ParallelAlfEnvironment)

Let me know if this works or not.

from alf.

Mming11 avatar Mming11 commented on August 31, 2024

Thanks a lot ! After adding these lines, it can run successfully.

from alf.

hnyu avatar hnyu commented on August 31, 2024
from alf.environments import parallel_environment
alf.config('create_environment', parallel_environment_ctor=parallel_environment.ParallelAlfEnvironment)

@Mming11 FYI, The issue has been fixed in PR #1461 . Now you can remove those two lines.

from alf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.