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

Training Problems #10

Closed
Uparrow0 opened this issue Aug 16, 2019 · 6 comments
Closed

Training Problems #10

Uparrow0 opened this issue Aug 16, 2019 · 6 comments

Comments

@Uparrow0
Copy link

When I train your model with your training data set , I get this error:
2019-08-16 21:04:48,300 - INFO - set log dir as ./logdir
2019-08-16 21:04:48,300 - INFO - set model dir as ./model
hhaha: <torch.utils.data.dataloader._DataLoaderIter object at 0x7f199e9516a0>
Traceback (most recent call last):
File "main.py", line 300, in
run_train_val(args.model)
File "main.py", line 228, in run_train_val
batch_t = next(dt_train)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 336, in next
return self._process_next_batch(batch)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 357, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 106, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/ubuntu/ZY/SPANet-master/dataset.py", line 28, in getitem
O = Image.fromarray(O)
File "/home/ubuntu/anaconda3/lib/python3.7/site-packages/PIL/Image.py", line 2642, in fromarray
arr = obj.array_interface
AttributeError: 'NoneType' object has no attribute 'array_interface'

As a green hand, I did a lot of research, but all failed.
Could you take a look at this problem for me? Thanks a lot!

@stevewongv
Copy link
Owner

stevewongv commented Aug 16, 2019

This error occurred when the data path was wrong. Please print the input data path to check whether it is right.
PS. We provide the pretrain model for you to test. You can directly use it! This model is stoped at 40K iterations.

@Uparrow0
Copy link
Author

I try to train my data,unfortunately it reported an error as:
2019-08-19 20:11:02,656 - INFO - train_derain--l1_loss:0.1316 mask_loss:0.002426 ssim_loss:0.9058 all_loss:0.2282 lr:0.005 step:349
2019-08-19 20:11:02,815 - INFO - train_derain--l1_loss:0.1307 mask_loss:0.0002747 ssim_loss:0.9148 all_loss:0.2162 lr:0.005 step:350
2019-08-19 20:11:02,986 - INFO - train_derain--l1_loss:0.08777 mask_loss:0.0005951 ssim_loss:0.8647 all_loss:0.2237 lr:0.005 step:351
2019-08-19 20:11:03,145 - INFO - train_derain--l1_loss:0.1028 mask_loss:1.526e-05 ssim_loss:0.8994 all_loss:0.2035 lr:0.005 step:352
Traceback (most recent call last):
File "main.py", line 299, in
run_train_val(args.model)
File "main.py", line 236, in run_train_val
batch_v = next(dt_val)
File "/home/user/anaconda2/envs/pytorch3.6/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 637, in next
return self._process_next_batch(batch)
File "/home/user/anaconda2/envs/pytorch3.6/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
AttributeError: Traceback (most recent call last):
File "/home/user/anaconda2/envs/pytorch3.6/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/user/anaconda2/envs/pytorch3.6/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 138, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/user/ZY/SPANet-master/dataset.py", line 37, in getitem
B = Image.fromarray(B)
File "/home/user/anaconda2/envs/pytorch3.6/lib/python3.6/site-packages/PIL/Image.py", line 2508, in fromarray
arr = obj.array_interface
AttributeError: 'NoneType' object has no attribute 'array_interface'

I wonder whether it is still a data path error ? Thanks!

@stevewongv
Copy link
Owner

You can just print the path of B to check the error.

@Uparrow0
Copy link
Author

Thanks for your reply.
I did the B path output, found that every time it broke down in the same image path, I guess there is something wrong in folder 'real_world.txt'.(ps:my 'real_world.txt' cantains my dataset path)
Could you tell me more details about the 'real_world.txt' folder? Thanks!

@stevewongv
Copy link
Owner

stevewongv commented Aug 19, 2019

You can just follow the way I used in 'real_world.txt' and put the image in folder. And then print the image path in dataloader to ensure that the image path is right.

@FUNGERN
Copy link

FUNGERN commented Dec 12, 2019

@Uparrow0 Have you solved the problem. I find that I can't find in which .py file to change the path of the training dataset and test dataset, if you know please tell me. thank you.

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

3 participants