Comments (2)
Hi,
I'm having the same problem, with the exception of I'm not really adapting the code (I am adapting it to newer versions of python and packages: tf.compat.v1 is a thing). I tried to get around the ValueError problem with:
if (cropped_frame[np.ix_([0, -1], [0, -1])] == np.array([0, 0], [0, 0])).all(): cropped_frame[np.ix_([0, -1], [0, -1])] = np.array([1, 1], [1, 1])
Which gave:
IndexError: index 0 is out of bounds for axis 0 with size 0
Perhaps this can be interpreted as the state passed in as a frame is an empty array (or smaller than 40 x 60, as there's potentially cropping that happens). If you come across a solution, I'm all ears!
from deep_reinforcement_learning_course.
The initial state/frame is empty. Because transform.resize upsamples, only 1 pixel is necessary (not sure if there's a reason to use more, but more complexity meant more problems for me). Trying to give an array of zeros wouldn't run: Apparently I needed a 2- or 3- tuple. Giving a 3- tuple (each pixel, in my case, is RGB) failed on normalizing, because division doesn't work with tuples. Finally got:
if np.size(cropped_frame) < 1:
# pixel = tuple(np.array([0, 0, 0], dtype='uint8'))
cropped_frame = np.array([0, 0, 0], dtype='uint8')
To work. Since you're using greyscale, depending on where you look for the empty frame, you may not need the array.
from deep_reinforcement_learning_course.
Related Issues (20)
- AttributeError: spec missing in TimeLimit wrapper HOT 1
- No romfiles found for game: SpaceInvaders-Atari2600 HOT 4
- Can anyone explain Why we have self.Q = tf.reduce_sum(tf.multiply(self.output, self.actions_), axis=1) in Deep Q learning with Doom.ipynb HOT 1
- Getting error on 2 seperate cells with instantiating memory and running tensorboard with Doom. HOT 3
- Deep Q learning: Algorithm
- bug in space invaders
- rewards_list variable in Deep Q Learning in Space Invaders HOT 2
- No issue, just praise and a suggestion
- Requirements .txt needed HOT 2
- Question for deep-q learning Algo
- Preprocessing returns a black screen HOT 1
- Performance of RND at Montezuma's Revenge
- Link to "Q* Learning with FrozenLake đšī¸â_unslippery" is broken
- DQN with Doom - Agent Performance
- bug in space invaders
- Dose this code "Policy Gradient/Doom" really work?
- who do struggle with tf.nn.softmax_cross_entropy_with_logits_v2 in Cartpole REINFORCE Monte Carlo Policy Gradients
- INPUT and OUTPUT
- Stuck at Local Minimum in PPO with CarRacing-v2 Environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ī¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep_reinforcement_learning_course.