GithubHelp home page GithubHelp logo

Comments (5)

samet-akcay avatar samet-akcay commented on July 20, 2024

I tried to replicate the error, but couldn't. By default the training data should be of size 45000, which is why the tensor size is 45000. Have you tried mnist? If so can you run python train.py --dataset cifar10?

from ganomaly.

ybpaopao avatar ybpaopao commented on July 20, 2024

@samet-akcay Hi, I tried to run python train.py --dataset cifar10 as you mentioned. However, it raise the same problem as follows:

Training model Ganomaly.
0%| | 0/781 [00:00<?, ?it/s]Traceback (most recent call last):
File "train.py", line 47, in
main()
File "train.py", line 44, in main
model.train()
File "/media/yangbiao/disk1/ganomaly-master/lib/model.py", line 307, in train
self.train_epoch()
File "/media/yangbiao/disk1/ganomaly-master/lib/model.py", line 272, in train_epoch
for data in tqdm(self.dataloader['train'], leave=False, total=len(self.dataloader['train'])):
File "/usr/local/lib/python3.5/dist-packages/tqdm/_tqdm.py", line 719, in iter
for obj in iterable:
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 281, in next
return self._process_next_batch(batch)
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 301, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 55, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 55, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/usr/local/lib/python3.5/dist-packages/torchvision/datasets/cifar.py", line 83, in getitem
img, target = self.train_data[index], self.train_labels[index]
IndexError: index 48784 is out of bounds for axis 0 with size 45000
PS: The index number (all numbers are larger than 45000) changes every time when I run "run python train.py --dataset cifar10". I guess whether the problem is caused by the version issue of the third-part libraries, such as torchvision and tqdm? 3Q

from ganomaly.

samet-akcay avatar samet-akcay commented on July 20, 2024

Maybe. I've used torchvision 0.1.9 and tqdm 4.15.0. Do you get any error when you run mnist?

from ganomaly.

ybpaopao avatar ybpaopao commented on July 20, 2024

@samet-akcay Yes, I got the same errors when I run mnist. I will check the versions of torchvision and tqdm.

from ganomaly.

ybpaopao avatar ybpaopao commented on July 20, 2024

@samet-akcay Hi, I'm glad to tell you that I can enjoy your code when I use torchvision 0.1.9 and tqdm 4.15.0. So, I think you can update your readme file to avoid such errors. 3Q!

from ganomaly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.