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

Do not show pre_transform UserWarning if force_reload=True #9721

Open
agitter opened this issue Oct 22, 2024 · 0 comments
Open

Do not show pre_transform UserWarning if force_reload=True #9721

agitter opened this issue Oct 22, 2024 · 0 comments

Comments

@agitter
Copy link

agitter commented Oct 22, 2024

📚 Describe the documentation issue

When testing changing the AddRandomWalkPE transform in the graph_gps.py example to AddLaplacianEigenvectorPE, I got the error

torch_geometric/data/dataset.py:240: UserWarning: The `pre_transform` argument differs from the one used in the pre-processed version of this dataset. If you want to make use of another pre-processing technique, pass `force_reload=True` explicitly to reload the dataset.

Even after setting force_reload=True, the warning still appears.

Looking at the source at

def _process(self):
f = osp.join(self.processed_dir, 'pre_transform.pt')
if osp.exists(f) and torch.load(f, weights_only=False) != _repr(
self.pre_transform):
warnings.warn(
"The `pre_transform` argument differs from the one used in "
"the pre-processed version of this dataset. If you want to "
"make use of another pre-processing technique, pass "
"`force_reload=True` explicitly to reload the dataset.")
f = osp.join(self.processed_dir, 'pre_filter.pt')
if osp.exists(f) and torch.load(f, weights_only=False) != _repr(
self.pre_filter):
warnings.warn(
"The `pre_filter` argument differs from the one used in "
"the pre-processed version of this dataset. If you want to "
"make use of another pre-fitering technique, pass "
"`force_reload=True` explicitly to reload the dataset.")

it looks as if the warning does not check force_reload. The warning appearing suggests ot the user that something is wrong. If I understand the behavior correctly, once force_reload=True the user had done everything correctly. I suggest suppressing the warning if force_reload=True.

Suggest a potential alternative/fix

Hide the warning when force_reload=True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant