TypeError: Expected 'Iterator' as the return annotation for __iter__ of SMILESParser, but found typing.Any
Closed this issue · 3 comments
Traceback (most recent call last):
File "exp/s3dis/debug/code/tools/train.py", line 8, in
from pcr.engines.defaults import default_argument_parser, default_config_parser, default_setup, Trainer
File "/truba/home/ahazer/PointTransformerV2-main/exp/s3dis/debug/code/pcr/engines/defaults.py", line 27, in
from pcr.models import build_model
File "/truba/home/ahazer/PointTransformerV2-main/exp/s3dis/debug/code/pcr/models/init.py", line 3, in
from .point_transformer2 import *
File "/truba/home/ahazer/PointTransformerV2-main/exp/s3dis/debug/code/pcr/models/point_transformer2/init.py", line 8, in
from .point_transformer_v2m1_origin import PointTransformerV2
File "/truba/home/ahazer/PointTransformerV2-main/exp/s3dis/debug/code/pcr/models/point_transformer2/point_transformer_v2m1_origin.py", line 13, in
from torch_geometric.nn.pool import voxel_grid
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch_geometric/init.py", line 2, in
import torch_geometric.data
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch_geometric/data/init.py", line 48, in
from torch_geometric.loader import NeighborSampler
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch_geometric/loader/init.py", line 3, in
from .dataloader import DataLoader
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch_geometric/loader/dataloader.py", line 9, in
from torch_geometric.data.datapipes import DatasetAdapter
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch_geometric/data/datapipes.py", line 36, in
class SMILESParser(IterDataPipe):
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch/utils/data/_typing.py", line 273, in new
return super().new(cls, name, bases, namespace, **kwargs) # type: ignore[call-overload]
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/abc.py", line 85, in new
cls = super().new(mcls, name, bases, namespace, **kwargs)
File "/truba/home/ahazer/.conda/envs/ahazerenv/lib/python3.8/site-packages/torch/utils/data/_typing.py", line 373, in _dp_init_subclass
raise TypeError("Expected 'Iterator' as the return annotation for __iter__
of {}"
TypeError: Expected 'Iterator' as the return annotation for __iter__
of SMILESParser, but found typing.Any
First of all, thank you very much for sharing the codes. I wanted to try it too, but I'm getting the above error. Can you help me ?
It seems that the error occurs in torch_geometric when from torch_geometric.nn.pool import voxel_grid
, could you provide your PyG version or reinstall it?
Thanks a lot, i've changed torch-geometric == 2.2.0 then error is solved. However, in this time i get RuntimeError: CUDA error: the provided PTX was compiled with an unsupported toolchain.