Skip to content

Commit

Permalink
[pkg] improve error message for module detection on saving pass (pyto…
Browse files Browse the repository at this point in the history
…rch#73106)

Summary:
Pull Request resolved: pytorch#73106

The original error message didn't have next steps, and someone got confused. This error message should make debugging a bit easier.

Test Plan: Imported from OSS

Reviewed By: ngimel

Differential Revision: D34559499

Pulled By: PaliC

fbshipit-source-id: fd5fec9c4db10a20775435a587bad24336a671ef
(cherry picked from commit efdcf1e)
  • Loading branch information
PaliC authored and pytorchmergebot committed Mar 2, 2022
1 parent 7b8fc74 commit e705193
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion torch/package/package_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,8 @@ def _check_mocked_error(module: Optional[str], field: Optional[str]):
f"Object '{field}' from module {module} was mocked out during packaging "
f"but is being used in resource - {resource} in package {package}. "
"If this error is happening during 'save_pickle', please ensure that your "
"pickled object doesn't contain any mocked objects."
"pickled object doesn't contain any mocked objects. Try interning or externing"
f"{module} if {field} is supposed to be in the package."
)
else:
return
Expand Down

0 comments on commit e705193

Please sign in to comment.