[JOSS] Examples
Closed this issue · 4 comments
Running analysis_example.py
in the examples/
folder results in the following error:
FileNotFoundError: [Errno 2] No such file or directory: 'xbb_foldingnet_checkpoints\\checkpoint_no_optimizer_state_dict_epoch167_loss0.003259085263643.ckpt'
This happens similarly for the following paths:
molearn/examples/analysis_example.py
Lines 32 to 33 in 070520c
I'd suggest to use os.path.join
to concatenate paths.
This is a bonus and not required at all for JOSS, but would it be possible to add a plotting output for the analysis script?
molearn/examples/analysis_example.py
Lines 50 to 58 in 070520c
The "generating error landscape" phase takes some time so the suspense runs high and it's a bit deceiving not to get any output. =)
When running bb_example_subclassing_trainer.py
I get the following error:
Traceback (most recent call last):
File "/home/rmeli/git/molearn/examples/bb_example_subclassing_trainer.py", line 127, in <module>
trainer.run(max_epochs = 32+trainer.epoch,**runkwargs)
File "/home/rmeli/git/molearn/src/molearn/trainers/trainer.py", line 181, in run
logs.update(self.valid_epoch(epoch))
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rmeli/git/molearn/examples/bb_example_subclassing_trainer.py", line 87, in valid_epoch
results['valid_DOPE'] = dope[:,0].mean()
~~~~^^^^^
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
Printing the shape of dope
I get (8,)
.
I apologise for the delayed reply.
commit ceff082 should add os.sep
to file names in analysis_example.py
. This was simply a mistake on our part.
commit 9ccea59 should add some simple plots. I agree it's a bit disappointing to run the script and get nothing at the end.
commit 68f788c should fix bb_example_subclassing_trainer.py
this is a simple bug due to the default behaviour of refine=True
changing and this script not being updated to reflect that change. Previously the returned array would have been of shape [n, 2]
where dope[:, 0]
would be unrefined dope scores and dope[:, 1]
would be refined dope scores. While the new behaviour returns an array of shape [n,]
with only the refined structures. I have updated the script to use the old behaviour by passing refine = 'both'
.
Thank you @SCMusson for fixing the few issues and for adding some simple plots, everything seems to work well now.
To avoid this kind of problems in the future (example scripts not following the changes in the code base), it might be worth thinking of testing them in CI (maybe only a few training step with a reduced model and data set).