Bug fix: 'ArgsParser' object has no attribute 'reg_loss' #38
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue :
while running the pretrained model using clean.py or run_segan+_clean.sh , it shows an error
AttributeError: 'ArgsParser' object has no attribute 'reg_loss'
.This same problem was also reported earlier in this repo, here is the link for it: #36
Fix:
added
"reg_loss": "l1_loss",
in segan_pytorch/ckpt_segan+/train.optsDue to this commit 9ade47b , a new command line option
--reg_loss
was added for training the model which initialized a variableself.reg_loss
present in segan/models/model.py in class SEGAN tol1_loss
ormse_loss
depending on the command line argument passed by the user.But the pretrained model was trained before that commit was made therefore it was trained without using
--reg_loss
option in command line andself.reg_loss
was initialized tol1_loss
. All the command line arguments used for training the pretrained model are stored in segan_pytorch/ckpt_segan+/train.opts and are loaded again when using the pretrained model using clean.py. So by adding"reg_loss": "l1_loss",
in segan_pytorch/ckpt_segan+/train.opts solves this issue.