Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in prediction when setting debug to true #96

Closed
hsulab opened this issue May 23, 2021 · 2 comments
Closed

Error in prediction when setting debug to true #96

hsulab opened this issue May 23, 2021 · 2 comments

Comments

@hsulab
Copy link

hsulab commented May 23, 2021

Dear Developers and Users,

When I set the debug to true in the config, the training worked well but an error occurred during the prediction.

    100              0.0202              0.0297        0.0007            0.0119            0.0148        0.0001     +  0.0163
Training completed in 1.969996690750122s
Traceback (most recent call last):
  File "./train_example.py", line 87, in <module>
    predictions = trainer.predict(images)
  File "/users/amptorch/trainer.py", line 245, in predict
    self.descriptor = construct_descriptor(self.config["dataset"]["descriptor"])
KeyError: 'descriptor'

After checking the source code, I found the following lines gave rise to this issue.

self.config["dataset"]["descriptor"] = descriptor_setup

I don't understand why self.config["dataset"]["descriptor"] is only set when if not self.debug? Should this be set no matter whether debug is on?

Many thanks,
Jiayan

@mshuaibii
Copy link
Collaborator

Hi Jiayan,

Thanks for catching this. This portion was recently modified and I must've missed testing the debug case. I have updated the code and respective tests to account for this - #97 . Hope this resolves it for you!

FWIW - since debug mode prevents writing checkpoints, etc. to disk, the model trained by will load the parameters of the last epoch rather than the best epoch (that would have been saved to disk if debug=False).

@hsulab
Copy link
Author

hsulab commented May 23, 2021

Hi Jiayan,

Thanks for catching this. This portion was recently modified and I must've missed testing the debug case. I have updated the code and respective tests to account for this - #97 . Hope this resolves it for you!

FWIW - since debug mode prevents writing checkpoints, etc. to disk, the model trained by will load the parameters of the last epoch rather than the best epoch (that would have been saved to disk if debug=False).

Thanks again! This helps me a lot. I will download the new code and the issue can be closed.

@hsulab hsulab closed this as completed May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants