You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm glad that the code is running successfully! However, I encountered an error while converting my trained model to Torchscript: RuntimeError: getattr's second argument must be a string literal: File "/root/miniconda3/lib/python3.8/site-packages/pytorch_metric_learning/utils/common_functions.py", line 275 def reset_stats(input_obj): for attr_list in ["_record_these_stats"]: for r in getattr(input_obj, attr_list, []): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
It seems there is an issue with the following code:
`# def reset_stats(input_obj):
for attr_list in ["_record_these_stats"]:
for r in getattr(input_obj, attr_list, []):
setattr(input_obj, r, 0)
`
I have been trying to resolve this for over two weeks and am not sure how to accurately and correctly convert the model to Torchscript format. Do you have any suggestions?
The text was updated successfully, but these errors were encountered:
I'm glad that the code is running successfully! However, I encountered an error while converting my trained model to Torchscript:
RuntimeError: getattr's second argument must be a string literal: File "/root/miniconda3/lib/python3.8/site-packages/pytorch_metric_learning/utils/common_functions.py", line 275 def reset_stats(input_obj): for attr_list in ["_record_these_stats"]: for r in getattr(input_obj, attr_list, []): ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
It seems there is an issue with the following code:
`# def reset_stats(input_obj):
for attr_list in ["_record_these_stats"]:
for r in getattr(input_obj, attr_list, []):
setattr(input_obj, r, 0)
`
I have been trying to resolve this for over two weeks and am not sure how to accurately and correctly convert the model to Torchscript format. Do you have any suggestions?
The text was updated successfully, but these errors were encountered: