cgcnn icon indicating copy to clipboard operation
cgcnn copied to clipboard

How to run CGCNN through Jupyter or Python interface

Open sgbaird opened this issue 4 years ago • 4 comments

I'm able to run CGCNN on a command line interface (PowerShell) through Anaconda, but I'm curious if you have suggestions for using it with an IDE.

sgbaird avatar Jan 06 '21 20:01 sgbaird

%run main.py data/sample-regression and %run predict.py pre-trained/formation-energy-per-atom.pth.tar data/sample-regression seem to do the trick in a Jupyter Notebook.

sgbaird avatar Jan 06 '21 22:01 sgbaird

For Spyder, one way to go about it is using runfile() or debugfile(), i.e.

runfile(<path-to-main.py>, args='data/sample-regression', wdir=<path-to-working-directory>)

or

debugfile(<path-to-main.py>, args='data/sample-regression', wdir=<path-to-working-directory>)

e.g.

runfile('main.py', args='data/sample-regression', wdir='.')

@mliu7051

sgbaird avatar Jan 07 '21 01:01 sgbaird

Another potential approach is to copy the code in main.py into a Jupyter notebook. This would allow to modify the code in the notebook as well.

txie-93 avatar Jan 21 '21 21:01 txie-93

Maybe you should copy and paste all the cgcnn code in your jupyter notebook in sequence, and should amend "args" part to a class with instance attributes. I am using cgcnn model like that. Until now, It's working well. hope you success!

Amadeus-System avatar Mar 04 '21 01:03 Amadeus-System