Python Flappy Bird AI Tutorial (with NEAT) - Implementing NEAT/Creating Fitness Function

  Рет қаралды 80,575

Tech With Tim

Tech With Tim

Күн бұрын

Пікірлер: 71
@Danielagostinho21
@Danielagostinho21 5 жыл бұрын
my heart stop beating when the message "check out next video!"
@yevgeniyvovk9788
@yevgeniyvovk9788 3 жыл бұрын
for x, bird in enumerate(birds): birds.pop(x) ... does not do what you want it to do. it will pop every other element. the way to do this is: for bird in list(birds): nets.pop(birds.index(bird)) ge.pop(birds.index(bird)) birds.remove(bird) not hating, I actually learned a lot from your tutorials, including this. so I hope this helps if someone runs into this issue like I did.
@CongNguyen-og3iz
@CongNguyen-og3iz 2 жыл бұрын
yeah I was thinking about this too. Thanks for the suggestions
@NoPh-md6dp
@NoPh-md6dp 3 жыл бұрын
you did the coding super detail but it is better if you show the result after finishing each period of code by running it. it is not necessary for you but it is for the viewers.
@Luis_Ramos_Grip
@Luis_Ramos_Grip 4 жыл бұрын
Can anyone explain this Error that i keep getting don't know how to fix.. I am running on Windows not a Mac i dont know if that's why i keep getting this issue. NameError: name '__file__' is not defined then it doesnt load the config file at all.
@hacklordmonster8780
@hacklordmonster8780 4 жыл бұрын
I get an error says "module 'neat' has no attribute 'defaultGenome'" edit: i did it with lower case d instead of capital D
@investwithmax6345
@investwithmax6345 4 жыл бұрын
that's was just that ? because i have the same pb with DefaultReproduction
@lexborodai1639
@lexborodai1639 4 жыл бұрын
I was sure I understand some python and AI topics before I bumped on these tutorials...
@sorzak_kriv8143
@sorzak_kriv8143 2 жыл бұрын
quick question! i closed my pc after saving the project, turned on the computer the next morning, ran the script and the base didnt show up. can anyone help? thanks! edit: nvm i was being stupid
@bryan192
@bryan192 2 жыл бұрын
I don't understand the "config-feedfoward.txt" part at 1:36
@坑爹先生
@坑爹先生 20 күн бұрын
its just a file name
@adamikhsannugroho
@adamikhsannugroho 5 жыл бұрын
What would need to be changed for you to have multiple output instead of one?
@theguyman232323
@theguyman232323 2 жыл бұрын
2 years later, but if you are still having this problem. All you have to do is change the number of outputs in the config file
@mikelee5376
@mikelee5376 4 жыл бұрын
Hello and thank you for this amazing tutorial! I have an error: module 'neat' has no attribute 'config'. I am using Spyder and neat-python v0.92. Do you know what this error is, and how to fix it?
@fernandazacche3216
@fernandazacche3216 3 жыл бұрын
me too! i dont know what to do D= did you manage to solve?
@deanbriggs2308
@deanbriggs2308 3 жыл бұрын
Hello I had the same problem as you. Answer: first uninstall neat (pip uninstall neat) next install neat-python (pip install neat-python) there problem solved.
@deanbriggs2308
@deanbriggs2308 3 жыл бұрын
Sorry I didn't see the part about you already having neat-python. My guess is probably the fact that neat and neat-python are both imported as neat. Try checking if neat is installed by uninstalling it.
@vp9041
@vp9041 5 жыл бұрын
Growing restless for next video everytime
@pizza_t1me
@pizza_t1me 5 жыл бұрын
Thank you for regular uploads!
@dan0_0nad76
@dan0_0nad76 4 жыл бұрын
Hello everyone, can anybody please explain me why the main() function Tim calls, doesn't have any actual parameter and still works? Cause i get this error wich I don't know how to fix: main() missing 2 required positional arguments: 'genomes' and 'config'
@elenkorkmaz4075
@elenkorkmaz4075 4 жыл бұрын
change Defaultgenome with defaultgenome
@SolomonWatkins2Bars
@SolomonWatkins2Bars 2 ай бұрын
I’m having the same issue and changing the genome did not work.
@penneshells5448
@penneshells5448 4 жыл бұрын
When you said, running them one at a time would be inefficient, I realised that doing that would actually help with an ai project I am working on, would you mind explaining what modifications or line of code you would need to do that? Thanks!
@fernandostroppa7312
@fernandostroppa7312 4 жыл бұрын
Go to the last video. Change the population to 1 (in the txt file). I hope that works for you.
@mathisfun3758
@mathisfun3758 5 жыл бұрын
Hi tim, im getting this error: Traceback (most recent call last): File "C:/Users/admin/PycharmProjects/Flappy-Bird/flappy-bird.py", line 5, in import neat ModuleNotFoundError: No module named 'neat' What do i do? Also, just wanna say love your teaching style!
@Fonn
@Fonn 5 жыл бұрын
you have to install the neat package for python I'm probably too late but still..
@aryanbhatia6992
@aryanbhatia6992 5 жыл бұрын
Can you tell in which university you are in ??
@tinatipton3291
@tinatipton3291 3 жыл бұрын
This is awesome thank you so much, I just had a question about determining genomes that have failed. If you were playing a game where it wasn't easy for a character or agent to die, or that the agent doesn't die, how might you get rid of that genome? Could it be something like done = False, while not done: (whatever the fitness function is) and then if done == True: remove(genome), print(genome_id, fitness)? Of course you'd have something that specifies what the genome is, and have genomes put in a list such as the ge = []. My trouble with this is I don't know if it would altogether get rid of the genome, and therefore you don't have any genomes to evolve and propagate a complex nn. Any help would be appreciated from anyone, thanks again.
@yosuanicolaus
@yosuanicolaus 2 жыл бұрын
I think you'd have to kill your agent yourself after some time. Say, every 20 seconds, you calculate their fitness and breed the next generation.
@pepik1335
@pepik1335 3 жыл бұрын
I did this project for 2 days and when I start the program, the window does not turn on and the program closes, there are no errors in the project
@snehpatel0359
@snehpatel0359 3 ай бұрын
Is you call a main() function or not?
@ujjvalw2684
@ujjvalw2684 5 жыл бұрын
Awesome video bud
@yudatriananda3558
@yudatriananda3558 4 жыл бұрын
The pipe and the bird player is too big in ny laptop screen, how to make them smaller:(
@limtis
@limtis 4 жыл бұрын
Is the window too big or the sprites? For the sprites: I guess you should either remove "pygame.transform.scale2x" from your code or just change the resolution of sprites. For the window: from ctypes import windll windll.user32.SetProcessDPIAware() # Removes DPI-Scaling
@yudatriananda3558
@yudatriananda3558 4 жыл бұрын
@@limtis yes i tried it but i still cant see the lower pipe because my laptop screen is too small can you help me
@yudatriananda3558
@yudatriananda3558 4 жыл бұрын
@@limtis i cant see the ground too
@limtis
@limtis 4 жыл бұрын
@@yudatriananda3558 pygame.transform.scale() resize to new resolution scale(Surface, (width, height), DestSurface = None) -> Surface
@yudatriananda3558
@yudatriananda3558 4 жыл бұрын
@@limtis i dont get it what line should i edit😅
@helloperson6823
@helloperson6823 2 жыл бұрын
what do you do if it says RuntimeError: 'NEAT' section not found in NEAT configuration file.
@luklucky9516
@luklucky9516 Жыл бұрын
press strg+s while on the config file. That were 2 hours of my life
@neuron8186
@neuron8186 3 жыл бұрын
how can it possible same code runs on your machine but not on mine
@saiprabhav2664
@saiprabhav2664 4 жыл бұрын
i made a game of snake but i wanted to train it 1 by 1 than a bunch of it so can you plz help..
@aarushanshankar2075
@aarushanshankar2075 4 жыл бұрын
my code just doesn't run. Help please?
@sashamuller9743
@sashamuller9743 4 жыл бұрын
what's your issue
@aarushanshankar2075
@aarushanshankar2075 4 жыл бұрын
@@sashamuller9743 When run my code I am getting the following error. Any help is really appreciated. TypeError: 'FeedForwardNetwork' object is not subscriptable My code is this: for _, g in genomes: net = neat.nn.FeedForwardNetwork.create(g, config) nets.append(net)
@FeedFall8
@FeedFall8 5 жыл бұрын
Great Videooo!
@urospocek4668
@urospocek4668 3 жыл бұрын
Can anyone explain to me why birds.pop(bird) while we loop through birds works fine? Thank you.
@redacted8188
@redacted8188 3 жыл бұрын
he only render birds in the list, so if the bird isnt in the list, once the screen is redrawn it will be gone
@sainco3036
@sainco3036 5 жыл бұрын
thanks.
@emilostergaard8139
@emilostergaard8139 4 жыл бұрын
Does anyone know what font he is using?
@emilostergaard8139
@emilostergaard8139 4 жыл бұрын
Also does someone know what the syntax theme is
@kajam3404
@kajam3404 5 жыл бұрын
I always get the same error, AttributeError: module 'neat' has no attribute 'Config', anyone who can help me?
@LotusP2
@LotusP2 5 жыл бұрын
did you install the correct module? "neat-python", not only "neat
@investwithmax6345
@investwithmax6345 4 жыл бұрын
@@LotusP2 love you so muchhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
@investwithmax6345
@investwithmax6345 4 жыл бұрын
@@LotusP2 thank youuu
@75hilmar
@75hilmar 2 жыл бұрын
Oh ge... 😂🤓
@emenikeanigbogu9368
@emenikeanigbogu9368 4 жыл бұрын
14:11 lmaooooo
@pravachanpatra4012
@pravachanpatra4012 2 жыл бұрын
8:15
@deniz5974
@deniz5974 5 жыл бұрын
You Whicg terminal
@TechWithTim
@TechWithTim 5 жыл бұрын
?
@deniz5974
@deniz5974 5 жыл бұрын
which terminal do you use
@eddyjimenez7655
@eddyjimenez7655 5 жыл бұрын
You don’t know what a terminal is do you?
@berkankucuklu377
@berkankucuklu377 5 жыл бұрын
Can I do a AI which plays Flappy Bird in C#?
@mandeepubhi4744
@mandeepubhi4744 5 жыл бұрын
You could do probably, but it will be messy.
@amirraza3463
@amirraza3463 4 жыл бұрын
Help me in that
@keshavbansal5148
@keshavbansal5148 4 жыл бұрын
While i appreciate you building this project Tim, might i say the code is just really bad, extremely confusing and its just one huge file. You can honestly make your videos a lot more structured if you just use multiple files. It would also help us learners to be able to progress faster.
AI Teaches Itself to Play Flappy Bird - Using NEAT Python!
10:16
Tech With Tim
Рет қаралды 143 М.
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 100 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 25 МЛН
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 11 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН
Neural Network Learns to Play Snake
7:14
Greer Viau
Рет қаралды 4,5 МЛН
The Manim Experience - Creating animations with Python
38:51
How To Make Money From Python - A Complete Guide
10:33
Tech With Tim
Рет қаралды 55 М.
this BASH script will make you a MILLIONAIRE
19:20
NetworkChuck
Рет қаралды 729 М.
Neat AI does Neat XOR Gen 0
9:17
Neat AI
Рет қаралды 12 М.
Function Calling in Ollama vs OpenAI
8:49
Matt Williams
Рет қаралды 37 М.
Automating My Life with Python: The Ultimate Guide | Code With Me
11:26
Python Flappy Bird AI Tutorial (with NEAT) - Finishing the Graphics
11:52
Why no RONALDO?! 🤔⚽️
00:28
Celine Dept
Рет қаралды 100 МЛН