Deep Reinforcement Learning for Atari Games Python Tutorial | AI Plays Space Invaders

  Рет қаралды 61,605

Nicholas Renotte

Nicholas Renotte

Күн бұрын

Пікірлер: 194
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Happy New Years y’all, wishing you all a super amazing 💯 2021!! Thanks for checkin’ in, see ya in the new year 😉
@shlokkumar6257
@shlokkumar6257 10 ай бұрын
Brother please reply, why these codes aren't working properly in tensorflow 2.10 above and keras 2.10 , infact i am providing render_mode for each env....please reply how to solve all these. i am stuck outta nowhere.
@ddrha770
@ddrha770 3 жыл бұрын
Never comment on KZbin, but can't even begin to express how well you taught this and how grateful I am. So hard to find someone who can teach this in a straight way, and you did it!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thank you so much @Derek, it means an absolute ton!!
@vertyco
@vertyco Жыл бұрын
This video is way too high quality for how few likes it has, excellent video man you explain everything very clearly, much appreciated!
@NoMercy8008
@NoMercy8008 3 жыл бұрын
I've discovered your channel just a couple days ago and watched only a few videos so far, but I want to say one thing: I really enjoy your content! Your videos are structured extremely well, which I find very helpful! I learned a lot already and I am looking forward to watching more of your videos! :) Thank you so much for making them! Much appreciated :)
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thank you soooo much, honestly really appreciate the feedback!
@pa-su6901
@pa-su6901 3 жыл бұрын
This is a good lecture. While studying reinforcement learning, while thinking about how to implement it, I saw this lecture and implemented it.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @AAA, glad you found it useful!
@archyt88
@archyt88 2 жыл бұрын
Hello from Russia and thanks for the great tutorials!
@markusbuchholz3518
@markusbuchholz3518 3 жыл бұрын
Great and innovative way in explanation rather difficult, abstracted and required some extra effort part of machine learning. Reinforcement learning together with deep learning are now extremely popular in different branches of our life. Probably great part of our life will be more and more affected by these technologies. It is amazing what you are doing Nicholas for the community. Your performance and consistent information are outstanding. Very impressive. Sooner or later (for sure in 2021) your channel will explode in number of new awesome subscribers. Reading the comment I can see it can be very reasonable to run jupyter in Google Colab so the community will avoid problem related with installation of packages and other dependencies. They will have more time to enjoy your content and perform other experiments. Wish you good luck!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @Markus! Your kind words are deeply appreciated, here's hoping I can continue to deliver some amazing videos and share what an awesome field machine learning and deep learning truly is!
@markusbuchholz3518
@markusbuchholz3518 3 жыл бұрын
​@@NicholasRenotte You are really great person! and will be soon thousands on your channel who give you similar feedback!
@Lutz1985
@Lutz1985 3 жыл бұрын
Thanks! That's an awesome tutorial! I did not know about keras-rl2 before. I have a question concerning performance. Do you use GPU or CPU-Only to get the ~16 steps per second? I'm asking because I tried with & without GPU and both seems slow. I rechecked my machine & CUDA working properly (Running Win10, Quadcore 3.8ghz intel, 16GB ram, GPU:1060 GTX 6GB, tensorflow 2.6.0, cuda 11.2) with a standard conv2d supervised learning job: 600s/epoch (CPU) --> 17s/epoch (GPU), nice.) When running the code from your example: can only get
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
I was hitting my head against a wall because the same happened to me. Apparently you don't anywhere near as large a speed boost with RL models as rendering and operating the environment is typically done on CPU rather than GPU, this overshadows much of the speed boost you'd get from GPU acceleration.
@LightHardt
@LightHardt 2 жыл бұрын
@@NicholasRenotte hello curious what you use as well to get that many steps a second. I tried using my RTX 2060 super and only get ~2.5 steps a second with cpu (Ryzen 5 3600) it’s about 1 a second. Are you just running insane hardware or do I not have it set up optimally?
@modernfusions1981
@modernfusions1981 2 жыл бұрын
Again, very resourceful video with great line by line explanation, which resolves almost all doubts.
@namithashaji7069
@namithashaji7069 2 жыл бұрын
Hi! Thank you for explaining the code line by line! It was very helpful to go through it and actually understand the code! But just wanted to ask if we can use the same code to create different versions of Atari games like Breakout-v0 or is this code specifically for SpaceInvaders?
@susmitvengurlekar
@susmitvengurlekar 3 жыл бұрын
One question, Shouldn't the no. Of warm-up timesteps be equal to the max limit of sequential memory ? In the example shown, the model will warm-up for 10000 timesteps but it can only remember the experience of last 1000 timesteps since that's the max limit of memory. Which is used for experience replay right ?
@ArMeD217
@ArMeD217 2 жыл бұрын
Good video, I really liked it. I have one question: why do you set a linear funcion as the activation function for the last layer of the DL model? Hadn't it to be a softmax function?
@jaixiyang5330
@jaixiyang5330 3 жыл бұрын
Great video I think! This helped me a lot during the study process of reinforcement learning.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @Jaixi, glad you. enjoyed. it!
@absimaldata
@absimaldata 3 жыл бұрын
1. output in last layer is linear, not softmax 2. learning rate is too small to start with. 3. the FC layer in model is too dense as compared to the filter stride in first level you took, which is just too high. 4. This will always give a better performance if this has residual blocks.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Solid suggestions @Aditya! What scores were you getting after running that type of tuning?
@patrickrogg2343
@patrickrogg2343 3 жыл бұрын
Really well explained! It would be great if you could explain why you choose the parameters when setting up the model. For example why did you choose 512 and 256 for the Dense layers? It would be cool if you could do an example for a multiplayer game :)
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Patrick, great question! Whenever building neural networks there's normally a bit of a trade off between train time/size of the model and performance. So a model with 512 units is likely to train faster than one with a dense layer that has 1024 units but the 1024 model might produce better performance. So, the number of units can be increased or decreased but may result in a performance drop off or a significant rise in training time. The MOST important thing however is that the first input layer (input_shape) and the final Dense layer stay the same, everything else can be tweaked and tuned.
@patrickrogg2343
@patrickrogg2343 3 жыл бұрын
@@NicholasRenotte Thanks for the answer !
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@patrickrogg2343 anytime, and oh we're definitely going to be doing a multiplayer game!
@jeremyheng8573
@jeremyheng8573 2 жыл бұрын
thank you for the tutorial! Will watch more your AI/ML videos
@randomizer272
@randomizer272 3 жыл бұрын
Firstly, Thank you for the wonderful video and saved weights. Can you direct me where can I learn about the policies and how to use according to the problem? Also, depending on the problem, How to create the Deep neural network? Keep up the good work. Extremely useful.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Sriram, stay tuned actually got something coming in this space soon!
@TheGmbgustavo
@TheGmbgustavo 3 жыл бұрын
Thank you for all your effort on spreading this knowledge. One question, whats the measurement unit of the height and width of the input conv2d layers? Pixels? I want to capture the image frames from a standalone game withouth using gym.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Yep, pixels!
@simoneabbate4989
@simoneabbate4989 Жыл бұрын
Hi Nicholas. I'm trying to run your code in Colab, but I'm having a problem building the model! Are weeks that I'm trying to solve, without solution :( When i run the line "model = build_model(height, width, channels, actions)", i got this Error "ValueError: Kernel shape must have the same length as input, but received kernel of shape (8, 8, 3, 32) and input of shape (None, 3, 210, 160, 3)." Can you please help me? Thank you very much.
@giorgosmodz8951
@giorgosmodz8951 Жыл бұрын
does the build_agent still work because i have this error why i call the build_agent RecursionError: maximum recursion depth exceeded while getting the repr of an object i tried to increase the maximum recursion depth but i get segmentation error. also the del model doesnt work beaucse is undefined at the point that you used it so i removed it
@mrniki54
@mrniki54 Жыл бұрын
Have you found an answer?
@gustavojuantorena
@gustavojuantorena 3 жыл бұрын
👏👏👏 Thank you for the interesting topic and happy new year!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Happy New Year @Gustavo! Thanks so much!
@vascopearson1018
@vascopearson1018 2 жыл бұрын
Hey! I'm getting this error: KeyError: 'SpaceInvaders-v0'. Do you know how I can solve it? Great video btw!
@取名好难-y2y
@取名好难-y2y 2 жыл бұрын
I do have the same problem and I can not solve it .........
@coded6799
@coded6799 3 жыл бұрын
Yo, d'ya have any Udemy/Coursera courses or something? I really wanna know how I can support you! I love your videos, they are so good, and they just keep getting better! I won't be surprised if you get a million subs by the end of this year!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Techie Dev, I started work on my first free course this week. I set a goal to crank one out a quarter, will shoot you a link as soon as it's out! And fingers crossed we get to a mil!!
@daiwikdhawan9504
@daiwikdhawan9504 3 жыл бұрын
What version of python are you using? BTW this video has helped me a lot! Thx!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Daiwik, I'm using 3.7.3 here. YESS, so glad it was useful!
@daiwikdhawan9504
@daiwikdhawan9504 3 жыл бұрын
@@NicholasRenotte Oh sorry abvout not including this is the comment but what type of jupyter are you using?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@daiwikdhawan9504 running it through Anaconda :) but just regular old jupyter notebook
@vikashchand.
@vikashchand. 3 жыл бұрын
Yo! This just keeps getting better! 🔥 Have an eventful new years eve 🍺🍺🍺😂
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Oh, I loved making this soo many more awesome RL ideas to come! How'd you find it?!
@creative-commons-videos
@creative-commons-videos 2 жыл бұрын
can you make a project on Chess AI ? using reinforcement learning
@kushangpatel983
@kushangpatel983 3 жыл бұрын
Great tutorial! Thanks, Nicholas!!!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @kushang!
@aiden9222
@aiden9222 2 жыл бұрын
Hey Nick, I got a question. Is it normal for the training to get significantly slower after each step? (Like one episode lasts 500+ seconds) I'm running this on an i5 cpu.
@govthamreddy
@govthamreddy 2 жыл бұрын
I am getting error at building a agent, kernel crashes when i call build_agent method
@deepgg_gaming
@deepgg_gaming 3 жыл бұрын
Nice tutorial! New to all of these and this awesome tutorial makes me wonder if it can be applied to gym-retro as well. I did try it out and everything went on well until the dqn.fit() line at the end of 3. Build Agent with Keras-RL. The training started, "Training for 10000 steps ..." has been outputted, but then I got a TypeError: 'int' object is not subscriptable from retro-gym (retro/retro_env.py, line 164-166). How should I change the code so that the action_to_array() function in the RetroEnv class can work properly? Fyi I'm trying gym-retro on raiden-snes. Part 1. of the tutorial (1. Test Random Environment with OpenAI Gym) works well. Appreciate your help!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @deep gunggung, can you shoot me your code and I can test it out?
@deepgg_gaming
@deepgg_gaming 3 жыл бұрын
@@NicholasRenotte Thanks and sure! KZbin keeps removing the link that I'm trying to post here. Can you let me know where should I send you my google drive project folder link?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@deepgg_gaming can you jump onto Discord and shoot it to me there?
@deepgg_gaming
@deepgg_gaming 3 жыл бұрын
@@NicholasRenotte Sure! add with me with KenDeep#8766 on Discord. I've checked out some other examples online and seems like maybe I'll need something like a "Wrapper" to make gym retro to recognize my commands?
@ninaanais5612
@ninaanais5612 Жыл бұрын
@@deepgg_gaming have you got the answer ,please whatr is it and how you fix it cause am getting the same error here
@modelworkzseo
@modelworkzseo 3 жыл бұрын
Great tutorial mate, cheers!!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks a bunch @Austin! Got some awesome RL stuff planned?
@navketan1965
@navketan1965 11 ай бұрын
SEEKING YOUR WISDOM, SIR, I have 2 choices--1) buy one given forex pair every new day at the open at market price wth take profit(TP) 50 pips and stop loss(SL)50 pips on one ticket as one order 2) second choice is to buy same pair but order is placed as pending order at the open of every new day--buy the same forex pair 100 pips below the open price as pending order with take profit of 50 pips and stop loss of 50 pips all on the same ticket.And after one year of every day trading which strategy is more likely to make any money?And what answer SUPERCOMPUTER would give to my question?
@swanandkulkarni126
@swanandkulkarni126 3 жыл бұрын
Loved the video, can you make one for RL theory?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Definitely, added to the list!
@sixtocorralescastle4092
@sixtocorralescastle4092 Жыл бұрын
when I try to do the den.fit() I get the error: 'int' object has no attribute shape, any way I can solve this?
@farazahmad9079
@farazahmad9079 Жыл бұрын
I am facing the same problem. Did you figure out the solution?
@rajabandlamudi4711
@rajabandlamudi4711 6 ай бұрын
@@farazahmad9079 same problem have u figured it out
@timfairfieldAETestandMeasure
@timfairfieldAETestandMeasure 3 жыл бұрын
Fantastic and up-to date
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @Tim! Glad you enjoyed it!
@dopo8333
@dopo8333 3 жыл бұрын
Very nice presentation. Thanks.
@oleksiy2090
@oleksiy2090 3 жыл бұрын
Thank you for a new Great video :) Great explanation. Waiting for me videos :) 👍🏻
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @Alex!!
@daiwikdhawan9504
@daiwikdhawan9504 3 жыл бұрын
Hello, Love this video super informational! I am having a slight problem with downloading tensorflow 2.3.1. It says that it cannot be found or something along those lines. I have python 39 and pip version 20.2.3. Do you have any insight on how to fix this?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
No stress, can you share the full error @Daiwik?
@daiwikdhawan9504
@daiwikdhawan9504 3 жыл бұрын
@@NicholasRenotte I put this in = "!pip install tensorflow==2.3.1 gym keras-rl2 gym[atari]" and the error message was = "ERROR: Could not find a version that satisfies the requirement tensorflow==2.3.1 (from versions: 2.5.0rc0, 2.5.0rc1, 2.5.0rc2, 2.5.0rc3, 2.5.0) ERROR: No matching distribution found for tensorflow==2.3.1"
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@daiwikdhawan9504 hmmm, can you try creating a new virtual environment and running the same code?
@daiwikdhawan9504
@daiwikdhawan9504 3 жыл бұрын
@@NicholasRenotte Same error code
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@daiwikdhawan9504 hmmm, not too sure. Is there a more detailed error?
@dimitheodoro
@dimitheodoro 3 жыл бұрын
Excellent!!!!!!!!!!!!!!!!!!!
@indianavenger8
@indianavenger8 5 ай бұрын
Env.render() not working for me it is not returning anything to visualize
@islam6916
@islam6916 3 жыл бұрын
Thank you so much for the video ❤ Hope you go for chess next time !!!
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Great idea! Let me look into it!
@parthpaladiya4786
@parthpaladiya4786 2 жыл бұрын
Hey Nicholas yours videos Rae too helpful to learn I want to know about how it work in 3d environment it will be very helpful if you can make video on 3d environment
@ritwikmohan7295
@ritwikmohan7295 2 жыл бұрын
hi nick , i am interested in A.I , can you tell career paths and what all i should be good at and how do i apporoach companies
@leonardopatricelli2933
@leonardopatricelli2933 2 жыл бұрын
Ciao Nick! I was wondering if is there any way to use reinforcement learning on Neo Geo Games. I would like to build an agent able to play Metal Slug. Do you know a way to do that?
@danielsilvafotografo7614
@danielsilvafotografo7614 Жыл бұрын
I have the following problem: 105 state.insert(0, self.recent_observations[current_idx]) 106 while len(state) < self.window_length: --> 107 state.insert(0, zeroed_observation(state[0])) 108 return state ... ---> 58 obs[key] = np.zeros(observation[key].shape) 59 return obs 60 elif hasattr(observation, '__iter__'): AttributeError: 'int' object has no attribute 'shape'
@shirinsiddiqui8050
@shirinsiddiqui8050 Жыл бұрын
Hey I have the exact same error! Did you manage to solve it?
@rajabandlamudi4711
@rajabandlamudi4711 6 ай бұрын
@@shirinsiddiqui8050 have u managed to solve the error please share the details if so
@mariaiqbal8600
@mariaiqbal8600 3 жыл бұрын
I have tried to follow your tutorials 'AI Resume Insights in 20 Minutes Using Personality Insights and Python' but am not able to find personality insight from IBM Watson as it is no more accessiable. I'll be very thankful if you guide me with an alternative solution.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Maria, unfortunately the service is no longer available through the cloud platform. I'm working on an open source alternative atm!
@johnpaulson5706
@johnpaulson5706 3 жыл бұрын
I am getting an error when I instantiate the model. The error comes at the first conv2d layer defined. the error is as follows: Input 0 of layer conv2d_1 is incompatible with the layer: expected ndim=4, found ndim=5. Full shape received: [None, 3, 210, 160, 3]. I was able to run the program when I removed 3 from input shape, ie input shape = (h,w,c). Is it enough to define the value 3 as batch size later or is there another solution to this
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @John, the first three here is the window history that's later set inside the Sequential Memory object. Just checking, you used input_shape and not input_dim?
@johnpaulson5706
@johnpaulson5706 3 жыл бұрын
@@NicholasRenotte I have raised the same in your github repo to make things easier. Thanking you for your time
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@johnpaulson5706 perfect, just took a look and replied!
@georgebennett934
@georgebennett934 3 жыл бұрын
Please help, I have the same problem
@johnpaulson5706
@johnpaulson5706 3 жыл бұрын
@@georgebennett934 the issue arised due to the version of tensorflow I was using. Just check if your library versions matches those given in the video.
@BicaramelMind
@BicaramelMind 3 жыл бұрын
Hi! I’m facing an issue when importing DQNAgent. The error message is “No module named rl.agents”. I am currently using Google Collab if that helps.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Hmm, try running !pip install keras-rl2, this should install the rl package which includes the agents!
@infinitygod5379
@infinitygod5379 2 жыл бұрын
It says gym no longer distributes ROMS What now? It's a very old game and i don't have any lisence of the game
@ahmarhussain8720
@ahmarhussain8720 Жыл бұрын
great explanation, thanks for the amazing content
@shwetakhonde8767
@shwetakhonde8767 3 жыл бұрын
I am getting this error, NoSuchDisplayException: Cannot connect to "None" while I am testing the random environment with open AIGym. what should I do to remove the error?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @shweta, are you running openai from a local machine or a cloud provider like colab?
@shwetakhonde8767
@shwetakhonde8767 3 жыл бұрын
@@NicholasRenotte I am running it on colab
@tommclean9208
@tommclean9208 3 жыл бұрын
Great video! Thanks
@tommclean9208
@tommclean9208 3 жыл бұрын
If you wanted to make a machine learning model of a robot, would it take a very, very long time to train? For instance, a robot that balances something vertically?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
I don't think that would take a huge amount of time. It would depend on a few things though most likely the number of axes the robot can move across and number of moving parts/actuators in the robotic arm. There's a few robotic models available in OpenAI gym, want a video on one?
@tommclean9208
@tommclean9208 3 жыл бұрын
@@NicholasRenotte That would be cool! I'll definitely watch if you do one. I was thinking more like because in real life,, you can only run one simulation at a time and each simulation has to run in real time (unless you were a huge company, i.e. tesla who has hundreds of thousands of 'robots' running at once). Would you pre-train a simulation model and then apply those weights to a real-world robot?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@tommclean9208 yep correct! This is where simulation environments like Unity really shine. You can build a simulated environment, train a model on it then deploy and test the model on a real world implementation!
@thelazydeveloper
@thelazydeveloper 2 жыл бұрын
Hello, sir, I am getting a small problem, after training my model got perfectioned on 1 action I tried Dropout... but nothing worked do you have any solution, please
@Samuel-wl4fw
@Samuel-wl4fw 3 жыл бұрын
I get ValueError: Input 0 of layer conv2d is incompatible with the layer: expected ndim=4, found ndim=5. Full shape received: [None, 3, 210, 160, 3] when trying to build the model at model = build_model(height, width, channels, actions)
@shihabal-arifi867
@shihabal-arifi867 3 жыл бұрын
Hi thank you ,plz can u help me 😢ihave problem when i installed tensorflow
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Definitely, what's the error?
@natasapapaa98
@natasapapaa98 3 жыл бұрын
I trained the agent in a procgen game named "Chaser" for 80 million steps and he doesn't seem to train at all. He is doing worse than a random agent. Any idea why is this happening? I can provide you with my code too.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Hmm, weird, could be a bunch of reasons tbh. What algo are you using?
@natasapapaa98
@natasapapaa98 3 жыл бұрын
@@NicholasRenotte I am using DQN agent, if you mean that.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@natasapapaa98 yep, could try PPO?
@harshgehlot5093
@harshgehlot5093 3 жыл бұрын
Thanks man, I was getting the error 'Sequential' object has no attribute '_compile_time_distribution_strategy'. But now it is gone.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Normally gotta delete the model then rerun the cell and it should kick off again!
@SamikshaRajpal-mr5wn
@SamikshaRajpal-mr5wn 7 ай бұрын
unable to build model ValueError: Kernel shape must have the same length as input, but received kernel of shape (8, 8, 3, 32) and input of shape (None, 3, 210, 160, 3).
@OR22
@OR22 7 ай бұрын
use this :import numpy as np from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten, Convolution2D from tensorflow.keras.optimizers import Adam def build_model(height, width, channels, actions): model = Sequential() model.add(Convolution2D(32, (8,8), strides=(4,4), activation='relu', input_shape=(height, width, channels))) model.add(Convolution2D(64, (4,4), strides=(2,2), activation='relu')) model.add(Convolution2D(64, (3,3), activation='relu')) model.add(Flatten()) model.add(Dense(512, activation='relu')) model.add(Dense(256, activation='relu')) model.add(Dense(actions, activation='linear')) return model
@emanuelepapucci59
@emanuelepapucci59 2 жыл бұрын
How I can install Keras? it doesn´t work very well...
@talhatahir9255
@talhatahir9255 3 жыл бұрын
Great 😍😍
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Thanks so much @talha tahir!
@Larry21924
@Larry21924 9 ай бұрын
This is top-of-the-line. I recently enjoyed a similar book, and it was top-of-the-line. "The Art of Saying No: Mastering Boundaries for a Fulfilling Life" by Samuel Dawn
@gabrielaraujo6761
@gabrielaraujo6761 2 жыл бұрын
i can apply this code in diferent environments ?
@yuhangzhou
@yuhangzhou Жыл бұрын
is pytorch code avaiable?
@majdodeh2733
@majdodeh2733 Жыл бұрын
So I tried this same code with a game called Breakout and when testing, the agent just doesn't move or moves all the way to the left and sits there. I trained 10000 steps. The game returns an image as well for state so I thought there should be no difference. Did anyone experience something similar? I'm training it now with Space Invaders to see if that changes anything.
@amankushwaha8927
@amankushwaha8927 2 жыл бұрын
Throws error on the newer versions of TensorFlow
@alishafii9141
@alishafii9141 3 ай бұрын
thanks, a lot
@jorgepacheco3407
@jorgepacheco3407 3 жыл бұрын
i got problems with the render of the env.render()
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Hmmm, what's happening @Jorge?
@stephwu8164
@stephwu8164 2 жыл бұрын
hello, I have tried your code and I got an error message at dqn.test(env, nb_episodes=100, visualize=True) it says : Exception has occurred: Error render(mode='human') is deprecated. Please supply `render_mode` when constructing your environment, e.g., gym.make(ID, render_mode='human'). The new `render_mode` keyword argument supports DPI scaling, audio, and native framerates.
@ApexArtistX
@ApexArtistX Жыл бұрын
VSCODE not jupyter its confusing
@infinitygod5379
@infinitygod5379 2 жыл бұрын
My kernel keeps dying at the agent part
@小郑嘎嘎6
@小郑嘎嘎6 3 жыл бұрын
TypeError: len is not well defined for symbolic Tensors. (dense_2/BiasAdd:0) Please call `x.shape` rather than `len(x)` for shape information.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya, double checking, what version of Tensorflow are you using?
@小郑嘎嘎6
@小郑嘎嘎6 3 жыл бұрын
@@NicholasRenotte Thanks for replying:) I'm using Tensorflow 2.3.1 and python 3.6
@inscseeker401
@inscseeker401 3 жыл бұрын
Use soft max tho
@OsamaElGhonimy
@OsamaElGhonimy 3 жыл бұрын
Have you tried it in code? I think it makes sense more than the linear activation
@inscseeker401
@inscseeker401 3 жыл бұрын
@@OsamaElGhonimy Unfortunately I have not tried it for this.
@tonysax7464
@tonysax7464 3 жыл бұрын
I get a FileNotFoundError because my program can't seem to find Space Invaders. Could not find module 'c:\users\tony\appdata\local\programs\python\python39\lib\site-packages\atari_py\ale_interface\ale_c.dll'
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Tony, check this out, you'll need to download ale_c.dll and place it in the correct directory: stackoverflow.com/questions/63080326/could-not-find-module-atari-py-ale-interface-ale-c-dll-or-one-of-its-dependenc
@learnteachexplore7509
@learnteachexplore7509 3 жыл бұрын
@@NicholasRenotte First of all thank you for sharing this tutorial and also replying for the comments. i have also had the same issue, the reason for this is atari-py is not so compatable with windows os is what i could understand. however we can resolve this by following instructions from this link below It works !!! github.com/openai/gym/issues/1726
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@learnteachexplore7509 yesss, awesome work. Thanks for sharing!!
@travelthetropics6190
@travelthetropics6190 3 жыл бұрын
@@learnteachexplore7509 Thanks, this helped to solve the same issue on my environment.
@Drk11wave
@Drk11wave 3 жыл бұрын
Great video! Just wondering how do you reduce the input size/resolution of the game being fed into the network.
@Drk11wave
@Drk11wave 3 жыл бұрын
I tried: height, width, channels = env.observation_space.shape actions = env.action_space.n inx = int(width/2) iny = int(height/2) height, width, channels = np.reshape(env.observation_space.shape, (inx, iny, 3)) ValueError: cannot reshape array of size 3 into shape (120,112,3) Any suggestions/help would be great! Im using Openai Gym Retro, the original shape is (224, 240, 3) Edit: Been trying all day now cant seem to figure it out XD
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Drk11wave, any reason why you're reshaping first? The input resolution shouldn't hammer the GPU too much. If you wanted to resize try using cv2.resize(). That being said you would need a wrapper environment to pass it to the algo!
@Drk11wave
@Drk11wave 3 жыл бұрын
@@NicholasRenotte Hi, Thanks for your reply! Im applying this to Pacman where the resolution is 224x240, once I start the training, the environment slows down heavily after about 20 seconds.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@Drk11wave are you rendering while training and/or using a GPU?
@Drk11wave
@Drk11wave 3 жыл бұрын
@@NicholasRenotte No, I stopped the rendering, but since it was taking very long to complete just one step I turned the rendering back on and it showed that after the first 20 seconds the game would move in slow motion. I thought this may be due to a large input.
@pitter6636
@pitter6636 3 жыл бұрын
If anyone trained the network to 5m or more, please share the trained weights ;). I would do it myself but with my current setup there is no way I can do even 1m.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Pitta, I’d hold off on using the weights for this model. I’m going to share weights for a different agent that’s been trained on 20m frames that’s smashing it atm.
@pitter6636
@pitter6636 3 жыл бұрын
@@NicholasRenotte I cant wait for the new agent and weights!. When will you share it?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Still training atm! Should be out maybe later this week coming or next. 😃
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@pitter6636 me too! Training and evaluating as we speak!
@pitter6636
@pitter6636 3 жыл бұрын
@@NicholasRenotte idem!, I'm trying to use the model in this paper >> nihit.github.io/resources/spaceinvaders.pdf
@babarmuaz5872
@babarmuaz5872 3 жыл бұрын
Hi nicolas i am ruuning it on m1-mac , there is strange error , your help is needed. error occurred while running `from pyglet.gl import i tried the solutions from this link but nothing worked github.com/openai/gym/issues/2101
@datgatto3911
@datgatto3911 3 жыл бұрын
Anyone realized that Random agent as nearly good as 1M agent :p?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
🤣 actually had a good laugh about this. It's been improved since, check this out: kzbin.info/www/bejne/pqezlGqqhtCJd5o
@inscseeker401
@inscseeker401 3 жыл бұрын
Use max pool tho
@musicstudios4418
@musicstudios4418 3 жыл бұрын
Atari is apparently bringing out a cryptocurrency or is already on the market. Has anyone heard of it?
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Nah, but sounds cool!
@ApexArtistX
@ApexArtistX Жыл бұрын
outdated tutorial
@edvinas4140
@edvinas4140 2 ай бұрын
How come, which specific parts are no longer working? I actually found that the logic still works, although perhaps you know something more and and clarify your argument?
@Skunk-420
@Skunk-420 3 жыл бұрын
How to look gay in a thumb nail
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
^ how to be a bigot in 2021
@ashkanforootan
@ashkanforootan Жыл бұрын
if you got err in Adam: use: from keras.optimizers import Adam instead of : from tensorflow.keras.optimizers import Adam
@saadiaouldsaada4003
@saadiaouldsaada4003 3 жыл бұрын
Thank you for the video it was very helpful. I wanted to implement what I've learnt here to the Pacman game but I got stuck with importing Roms I got this error : zsh: parse error near ` ' I've tried to import it using this command : python -m atari_py.import_roms Can you help solving this? thanks
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Double check your file path, this looks like the path hasn't been specified correctly.
@travelingdiaries547
@travelingdiaries547 Жыл бұрын
RecursionError: maximum recursion depth exceeded while calling a Python object plzzz help
@happydays334
@happydays334 5 ай бұрын
Make it lower
@Gordonias
@Gordonias 2 жыл бұрын
Hi, i'm getting a recursion error whenever I try to build the agent. It seems that my kernel dies everytime i try to run the program
@gianluca3131
@gianluca3131 2 жыл бұрын
Same. I thought it was a VRAM problem and reduced the model complexity but it still crashes every time. Did you find a solution?
@nithinyadav221
@nithinyadav221 3 жыл бұрын
Unable to find game "SpaceInvaders", did you import SpaceInvaders with ale-import-roms? i am getting this error please help me
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Double check you've installed space invaders using the new roms. I show how to do it in the big reinforcement learning course!
@varunsharma7706
@varunsharma7706 3 жыл бұрын
I'm getting this error "Unable to open file (file signature not found)" when I tried to open the trained weights file. Please let me know how to fix this.
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
Heya @Varun, do you have the file path set correctly?
@varunsharma7706
@varunsharma7706 3 жыл бұрын
@@NicholasRenotte Yeah it's absolutely correct
@NicholasRenotte
@NicholasRenotte 3 жыл бұрын
@@varunsharma7706 hmm, not too sure then, were the weights saved?
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 11 МЛН
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 20 МЛН
An introduction to Reinforcement Learning
16:27
Arxiv Insights
Рет қаралды 659 М.
A. I. Learns to Play Starcraft 2 (Reinforcement Learning)
17:42
AI Learns to Walk (deep reinforcement learning)
8:40
AI Warehouse
Рет қаралды 9 МЛН
Deep Q Learning is Simple with PyTorch | Full Tutorial 2020
38:55
Machine Learning with Phil
Рет қаралды 106 М.
Python Pong AI Tutorial - Using NEAT
1:18:13
Tech With Tim
Рет қаралды 105 М.
A.I. Learns to Play Space Invaders | Reinforcement Learning
10:10
Nicholas Renotte
Рет қаралды 11 М.
Everything You Need To Master Actor Critic Methods | Tensorflow 2 Tutorial
40:47
Machine Learning with Phil
Рет қаралды 49 М.