njszym / XRD-AutoAnalyzer

MIT License
77 stars 17 forks source link

run example/run_CNN.py cause windows problem report make predict fail #2

Closed linhuaizhou closed 9 months ago

linhuaizhou commented 2 years ago

when i finish setup an let fastdtw use cpp mode , the program sill run with high CPU occupancy and 100% ram .so i debug the code, find autoXRD/spectrum_analysis/init.py at 529 line "result.append(self.model(x, training=True))" cause so many time and cause windows problem report . After check the report , most of them are talking about memory overflow and space call errors.I don't know if my tensorflow is not installed properly.After all, according to readme, it only takes a few seconds for a single core CPU to complete the prediction. _I(58LOI@}_ZSQ~YY$4SQ9B At present, my research group is also conducting research on the prediction of material properties by XRD images based on in-depth learning. I hope you can help me solve the problems in the package and communicate with you more. Thank you !

njszym commented 2 years ago

Thanks for brining this issue to my attention. A high CPU usage is definitely possible, though even on slow systems the classification of a single pattern should only take about 10-20 seconds.

Before going further, I'd first recommend reinstalling the latest version of XRD-AutoAnalyzer. I recently switched over from fastdtw to pyts for dynamic time warping, which seems to be more reliable and also avoids any installation issues with the cpp implementation.

If your program still runs slow when using the updated version, can you let me know how long it takes (if it finishes at all)? And what error messages are popping up?

For troubleshooting: if it doesn't finish within a reasonable time, you could also try reducing n_iter in the predict() function.

BTW: the example folder contains 8 patterns -- so classifying all of these may take > 1 minute on slower systems.

linhuaizhou commented 2 years ago

Thank you for your reply. I will try the latest version and test it, and then try the method you mentioned. Ps:This is the first time to leave a message on GitHub via issue. I didn't expect you to reply so quickly. It's a great feeling!!!:)

------------------ Original ------------------ From: Nathan Szymanski @.> Date: Wed,Jun 22,2022 1:06 AM To: njszym/XRD-AutoAnalyzer @.> Cc: 1hz @.>, Author @.> Subject: Re: [njszym/XRD-AutoAnalyzer] run example/run_CNN.py cause windowsproblem report make predict fail (Issue #2)

linhuaizhou commented 2 years ago

Thank you ! This problem can be solved by installing Tensorflow-CPU. When running setup.py, Pycharm will install the default version of tensorflow when installing. This seems to cause some problems. When I manually configure the required packages of the installation environment and install Tensorflow-CPU, it can run normally.

njszym commented 2 years ago

Got it, I'll take this into account of future updates, thanks for the info!