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

Who can help me slove this error? (when I try to train ) #175

Open
lgl1227 opened this issue Jan 25, 2022 · 5 comments
Open

Who can help me slove this error? (when I try to train ) #175

lgl1227 opened this issue Jan 25, 2022 · 5 comments

Comments

@lgl1227
Copy link

lgl1227 commented Jan 25, 2022

python train.py --model 1 --checkpoints ./checkpoints/celebA

Training epoch: 1
loading error: datasets/celebA/train/000195.jpg
Traceback (most recent call last):
File "E:\PycharmProject\edge-connect\src\dataset.py", line 41, in getitem
item = self.load_item(index)
File "E:\PycharmProject\edge-connect\src\dataset.py", line 71, in load_item
mask = self.load_mask(img, index)
File "E:\PycharmProject\edge-connect\src\dataset.py", line 139, in load_mask
mask_index = random.randint(0, len(self.mask_data) - 1)
File "E:\Anaconda3\lib\random.py", line 222, in randint
return self.randrange(a, b+1)
File "E:\Anaconda3\lib\random.py", line 200, in randrange
raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0,0, 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "train.py", line 2, in
main(mode=1)
File "E:\PycharmProject\edge-connect\main.py", line 56, in main
model.train()
File "E:\PycharmProject\edge-connect\src\edge_connect.py", line 99, in train
for items in train_loader:
File "E:\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "E:\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "E:\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\PycharmProject\edge-connect\src\dataset.py", line 44, in getitem
item = self.load_item(0)
File "E:\PycharmProject\edge-connect\src\dataset.py", line 71, in load_item
mask = self.load_mask(img, index)
File "E:\PycharmProject\edge-connect\src\dataset.py", line 139, in load_mask
mask_index = random.randint(0, len(self.mask_data) - 1)
File "E:\Anaconda3\lib\random.py", line 222, in randint
return self.randrange(a, b+1)
File "E:\Anaconda3\lib\random.py", line 200, in randrange
raise ValueError("empty range for randrange() (%d,%d, %d)" % (istart, istop, width))
ValueError: empty range for randrange() (0,0, 0)

@song201216
Copy link

我也有这个错误,不知道您解决了没有

@lgl1227
Copy link
Author

lgl1227 commented Mar 28, 2022

并没有 我现在没有在看这个代码了

@song201216
Copy link

song201216 commented Mar 28, 2022 via email

@Chaneky
Copy link

Chaneky commented Apr 3, 2022

谢谢,我已经解决了

------------------ 原始邮件 ------------------ 发件人: "Alex @.>; 发送时间: 2022年3月28日(星期一) 下午4:34 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [knazeri/edge-connect] Who can help me slove this error? (when I try to train ) (Issue #175) 并没有 我现在没有在看这个代码了 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
我也有这个问题,请问怎么解决的啊,谢谢!

@kaylahoo
Copy link

能不能解决一下啊

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

4 participants