lukasruff / Deep-SVDD-PyTorch

A PyTorch implementation of the Deep SVDD anomaly detection method
MIT License
698 stars 197 forks source link

CIFAR10 example cannot work #9

Closed tiffany61706 closed 5 years ago

tiffany61706 commented 5 years ago

Hi Thank you for sharing the code. I tried to run the cifar10 example; however, I got an error like the bottom. Is there something wrong in reading cifar10 dataset? (btw, I can run mnist example perfectly.)

image

lukasruff commented 5 years ago

Hi,

sorry for my late response.

The error is due to a refactoring of the torchvision datasets that came with PyTorch 1.0. The self.train_labels and self.train_labels attributes of CIFAR10 were replaced with self.targets for consistency.

If you install the required Python modules with versions as listed in requirements.txt, the example should run fine.

Especially

torch==0.4.1
torchvision==0.2.1

are relevant here.

I'm planning to put everything in line with the latest release of PyTorch soon.

coderKyf commented 5 years ago

@tiffany61706 Hi, Have you solved this problem? How can I run this code in PyTorch 1.0.

omid-ghozatlou commented 3 years ago

Hi! @tiffany61706 It is working on MNIST however I got a warning the following variables has renamed automatically. But for the CIFAR10 dataset, I replaced self.targets instead of self.train_labels and self.test_labels as well as self.data instead of self.train_data and self.test_data