hardmaru / WorldModelsExperiments

World Models Experiments
626 stars 172 forks source link

Gray screen on running dream_model.py #18

Closed Chazzz closed 5 years ago

Chazzz commented 5 years ago

python3 model.py render log/carracing.cma.16.64.best.json executes without errors, but for some reason the car wanders slowly and aimlessly. I've tracked it down to python3 dream_model.py log/carracing.cma.16.64.best.json generating a grey screen. My theory is that the two errors are correlated, but I'm a little lost as to what would cause the grey screen.

The default box2d install gives an error related to a swig dependency mismatch on runtime, so I cloned the box2d repo and ran setup.py clean/build/install.

Code run: python3 dream_model.py log/carracing.cma.16.64.best.json

Expected output: Virtual data generated by model rendered to screen in popup

Actual output: Popup with 'dream_model.py' title but gray image

Stack:

$lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:    18.10
Codename:   cosmic
$ python3 --version
Python 3.6.7
$ pip3 show gym
Name: gym
Version: 0.9.2
Summary: The OpenAI Gym: A toolkit for developing and comparing your reinforcement learning agents.
Home-page: https://github.com/openai/gym
Author: OpenAI
Author-email: gym@openai.com
License: UNKNOWN
Location: /home/vincent/.local/lib/python3.6/site-packages
Requires: requests, pyglet, six, numpy
$ pip3 show numpy
Name: numpy
Version: 1.16.0
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: /home/vincent/.local/lib/python3.6/site-packages
Requires: 
$ pip3 show tensorflow
$ pip3 show tensorflow-gpu
Name: tensorflow-gpu
Version: 1.12.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /home/vincent/.local/lib/python3.6/site-packages
Requires: astor, tensorboard, grpcio, wheel, keras-applications, absl-py, keras-preprocessing, termcolor, six, protobuf, gast, numpy
$ pip show box2d
$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Box2D
>>> Box2D.__version__
'2.3.2'
hardmaru commented 5 years ago

Hi @Chazzz

Thanks for highlighting this issue. I did some digging and it seems that the PR that @davidsandberg had kindly submitted earlier to fix memory leaks for DoomRNN had some issues on CarRacing experiment causing it to not load the weights of the VAE and RNN from the JSON files. It's fixed now and I think it should work for CarRacing, please try again.

Chazzz commented 5 years ago

Hi @hardmaru

Thank you so much for your help, I'll let the results speak for themselves. Got 910 on first run too!

FYI from a blank environment I needed to install scipy, pillow, and box2d-py in addition to tensorflow(-gpu) and gym==0.9.4.

success

TyPh00nCdr commented 5 years ago

The same fix from 0a5a10cd80e44c1dd8c28e5e50d1a9501a4317d0 needs to be applied to doomrnn.py, too (i.e. delete each of the 3 occurences of if var.name.startswith('mdn_rnn'): and if var.name.startswith('conv_vae'):).