简体   繁体   中英

Can python start debugging on specific line?

I am using Spyder and PyCharm. I would like to know if it is possible to debug on specific line? (Said Line 150)

Because I want to do machine learning, and because it takes a lot of time, I dont wat to repeat the training if I have problem on another line.

Thankyou

Yes, it's possible, but all the code before has to be executed before. Maybe we have a missunderstand with the "debug" word but this isn't the point. What you can do, is save the weights and architecture of the network, and load them instead of trainning all again, and then make your debug.

For machine learning I recommend using Jupyter notebook since it makes your programming and debugging tasks much more modular in the sense that you don't have to execute your full script every time but rather cells. Especially for data wrangling Jupyter notebook gives a much more structured overview. For debugging purposes, being able to run cells in any order works wonders.

Getting used to Jupyter is worthwhile especially if you are working with data science.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM