kaolin icon indicating copy to clipboard operation
kaolin copied to clipboard

point_cloud_classification.ipynb: TypeError: initialize() got an unexpected keyword argument 'device'

Open msieb1 opened this issue 5 years ago • 2 comments

In the example notebook, the dataset class does not accept a device argument. How does one cast the loader to cuda in this example?:

val_loader = DataLoader(ModelNet(modelnet_path, categories=categories,
                                 split='test',transform=transform, device=device),
                        batch_size=12)

yields

 in __init__(self, preprocessing_transform, preprocessing_params, transform, no_progress, *args, **kwargs)
     89             no_progress (bool): disable tqdm progress bar for preprocessing.
     90         """
---> 91         self.initialize(*args, **kwargs)
     92         if preprocessing_transform is not None:
     93             desc = 'Applying preprocessing'

TypeError: initialize() got an unexpected keyword argument 'device'

If run without device arg:

engine = ClassificationEngine(PointNet(num_classes=len(categories)),
                              train_loader, val_loader, device=device)
engine.fit()

yields

RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

msieb1 avatar May 12 '20 21:05 msieb1

What works is adding a cuda cast to the data via transforms and label via _get_attributes works (albeit hacky).

msieb1 avatar May 12 '20 22:05 msieb1

Thank you @msieb1 for helping us make Kaolin better! If you still had trouble getting started with that example, PR #264 fixes the issues you found.

Jean-Francois-Lafleche avatar May 19 '20 00:05 Jean-Francois-Lafleche

Closing as this is related to v0.1

Caenorst avatar Dec 12 '22 23:12 Caenorst