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

Problem in training. #6

Open
vdsprakash opened this issue Feb 19, 2019 · 1 comment
Open

Problem in training. #6

vdsprakash opened this issue Feb 19, 2019 · 1 comment

Comments

@vdsprakash
Copy link

File "main.py", line 138, in
main()
File "main.py", line 128, in main
train(config.epoch, iteration, dataloader, my_net, optimizer, optimizer2, device)
File "main.py", line 59, in train
for i_batch, sample in enumerate(dataloader):
File "/home/denny/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 317, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/denny/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 317, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/datasets.py", line 84, in getitem
image, label = self.train_data_transform(index)
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/datasets.py", line 103, in train_data_transform
img = self.read_image(self.images_dir, index)
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/datasets.py", line 34, in read_image
image = ImgTransform.ReadImage(filename)
File "/home/denny/github_open_Sources/PixelLink-with-pytorch/ImgLib/ImgTransform.py", line 16, in ReadImage
with Image.open(filename) as img:
File "/home/denny/anaconda3/envs/pytorch/lib/python3.6/site-packages/PIL/Image.py", line 2609, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'training_images/images/img_tensor(956).jpg'

@fanjianing
Copy link

because the type of index is Tensor.
you can useindex = int(index) + 1 to solve the issue.

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

No branches or pull requests

2 participants