rlvaugh / Impractical_Python_Projects

Code & supporting files for chapters in book
408 stars 270 forks source link

stacked_images #9

Open dougler opened 4 years ago

dougler commented 4 years ago

I enteredcode from book. When I ran the code..I got "MemoryError"
while processing the
green_data.appendlist(image.getdata(1)))

so I copied the code from the github file got same error with the blue_data.append ...line. looked for a n errata for pg.338 but found none. ??

rlvaugh commented 4 years ago

dougler, I ran the code on my system and encountered no problems. I'm using a Dell XPS laptop with an Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2.40GHz and 8 GB RAM (7.85 GB usable). Running Windows 10 64 bit.

After first running the crop_n_scale_images.py code, you may want to try restarting your computer and then running the stacking program. Shut down your browser and any other non-essential programs to reduce memory load.

dougler commented 4 years ago

Thanks I tried a cold start and got the same result. I downloaded your code and got the same problem. I then played around cropping the # of images to stack. Of the original 256, 205 worked a little above that I got the MemError. My research indicated that a 64Bit Python 3 would give more memory but I’m not sure what issues that transition would cause and I was sure you would have forewarned if this was an issue. So I stacked the 205....still difficult to see the red spot. I have really enjoyed Working through your exercises.

On Wed, Sep 16, 2020 at 7:53 AM rlvaugh notifications@github.com wrote:

dougler, I ran the code on my system and encountered no problems. I'm using a Dell XPS laptop with an Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz 2.40GHz and 8 GB RAM (7.85 GB usable). Running Windows 10 64 bit.

After first running the crop_n_scale_images.py code, you may want to try restarting your computer and then running the stacking program. Shut down your browser and any other non-essential programs to reduce memory load.

Sorry for the late reply, for some reason I can't get github to alert me when there's an issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rlvaugh/Impractical_Python_Projects/issues/9#issuecomment-693459353, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANARLRPWZNDL5LWCPEGJHEDSGDGNLANCNFSM4QWRMNEQ .

-- Regards, Doug Brown

rlvaugh commented 4 years ago

Doug, there are so many platforms, Python versions, operating system versions, etc. that's it's impossible to anticipate every problem. I pay a guy to run everything on a Mac (I use Windows) and he finds a lot of stuff, but that's just for Catalina. If he used Mojave or another release he would find a different set of problems.

I'm glad you got it to run. To see the results of using all the images, take a look at the PDFs for Figure 15-9 and Figure 15-10 in the Chapter 15 folder on github. The red spot is more visible than in individual frames, but like I say in the book, it won't win any photography prizes. The starting data was too noisy, but then that was the point.

I upgraded to Python 3 64 bit a few years ago and encountered no problems running older Python code, so if you do upgrade, hopefully you won't encounter any issues.

I'm glad you're enjoying the book. Real-World Python is out next month (Covid willing). You can preview it on Amazon. It's a similar format to Impractical Python Projects but uses more sophisticated tools such as OpenCV (computer vision) and pandas (data analysis), among others. Your current set-up may present problems with the computer vision projects in Chapters 9 and 10.

dougler commented 4 years ago

I completed 10, no problems. I’ve put off the Haiku exercises. Only a few left I’ll check out the new book. I bought the Playground book. It, like yours, looks like it will be an expanding experience.

On Wed, Sep 16, 2020 at 9:26 AM rlvaugh notifications@github.com wrote:

Doug, there are so many platforms, Python versions, operating system versions, etc. that's it's impossible to anticipate every problem. I pay a guy to run everything on a Mac (I use Windows) and he finds a lot of stuff, but that's just for Catalina. If he used Mohave or another release he would find a different set of problems.

I'm glad you got it to run. To see the results of using all the images, take a look at the PDFs for Figure 15-9 and Figure 15-10 in the Chapter 15 folder on github. The red spot is more visible than in individual frames, but like I say in the book, it won't win any photography prizes. The starting data was too noisy, but then that was the point.

I upgraded to Python 3 64 bit a few years ago and encountered no problems running older Python code, so if you do upgrade, hopefully you won't encounter any issues.

I'm glad you're enjoying the book, Real-World Python is out next month (Covid willing). You can preview it on Amazon. It's a similar format to Impractical Python Projects but uses more sophisticated tools such as OpenCV (computer vision) and pandas (data analysis), among others. Your current set-up may present problems with the computer vision projects in Chapters 9 and 10.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rlvaugh/Impractical_Python_Projects/issues/9#issuecomment-693518140, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANARLROSOFELPVWMUPFIRO3SGDRM7ANCNFSM4QWRMNEQ .

-- Regards, Doug Brown