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.

AttributeError: 'ScaledFloatFrame' object has no attribute 'num_envs'

See original GitHub issue

When I run: python3 -m baselines.run --alg=ppo2 --env=SuperMarioBros-Nes --num_timesteps=2e7

I get this error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/fanbingbing/ML/baselines/baselines/run.py", line 239, in <module>
    main()
  File "/home/fanbingbing/ML/baselines/baselines/run.py", line 213, in main
    model, env = train(args, extra_args)
  File "/home/fanbingbing/ML/baselines/baselines/run.py", line 79, in train
    **alg_kwargs
  File "/home/fanbingbing/ML/baselines/baselines/ppo2/ppo2.py", line 295, in learn
    nenvs = env.num_envs
AttributeError: 'ScaledFloatFrame' object has no attribute 'num_envs'

I made a temporary fix but get other similar errors further.

Additional info: Ubuntu 18.04 Python 3.6.6 synced baselines with latest commit: 28aca63

retro env works fine with SuperMario when I test it directly so it’s not an issue with retro env not working Also the example command provided in the readme works fine: python3 -m baselines.run --alg=ppo2 --env=PongNoFrameskip-v4 --num_timesteps=2e7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MatPoliquincommented, Oct 27, 2018

ok it now works, I added retro defaults for ppo2, make use of the retro deepmind wrapper as well as set ‘cnn’ as default network. I made pull requests

0reactions
pzhokhovcommented, Oct 25, 2018

This can be caused by default nsteps being too large. We have the values tuned down for atari games by default, but not retro. You could do that by running with options --nsteps=128 --nminibatches=4 (first one decreases the number of rollout steps per update, second - number of minibatches those steps are split into)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting AttributeError: Object has no attribute? [closed]
Your indentation is goofed, and you've mixed tabs and spaces. Run the script with python -tt to verify.
Read more >
Why am I getting AttributeError: Object has no attribute?
PYTHON : Why am I getting AttributeError : Object has no attribute ? [ Gift : Animated Search Engine ...
Read more >
Python AttributeError — What is it and how do you fix it?
AttributeError : '***' object has no attribute '***'What is an AttributeError in Python? What can you do to fix it? When does it...
Read more >
Unit 7. Modifying the learning algorithm: Cartpole error
Hi, I have implemented everything and getting following error at the end. ... AttributeError: 'NoneType' object has no attribute 'shape' ...
Read more >
Getting Started With OpenAI Gym: The Basic Building Blocks
We start with an environment called MountainCar , where the objective is to ... If you have an error to the tune of...
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