TypeError: function takes exactly 5 arguments (1 given)
See original GitHub issuewhen i train my dataset, i got this error
Traceback (most recent call last):
File "train_net.py", line 192, in <module>
main()
File "train_net.py", line 185, in main
model = train(cfg, args.local_rank, args.distributed)
File "train_net.py", line 86, in train
arguments,
File "/root/maskrcnn-benchmark-sync/tools/../maskrcnn_benchmark/engine/trainer.py", line 68, in do_train
for iteration, (images, targets, _) in enumerate(data_loader, start_iter):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 623, in __next__
return self._process_next_batch(batch)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 658, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: function takes exactly 5 arguments (1 given)
i think there is some error in dataset, i have checked my dataset , for example label,box valid…, but nothing help. so i trace the code to find the reason, i trace here, line 137 at dataloader.py
try:
samples = collate_fn([dataset[i] for i in batch_indices])
except Exception:
# It is important that we don't store exc_info in a variable,
# see NOTE [ Python Traceback Reference Cycle Problem ]
data_queue.put((idx, ExceptionWrapper(sys.exc_info())))
else:
data_queue.put((idx, samples))
del samples
i think problem is in BatchCollator, but i can not find any function need 5 arguments. one more thing, i train with batchsize 1 on one gpu look fine.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Error: TypeError: function takes exactly 5 arguments (1 given)
Hi, I just installed RAW on windows 10 using RAW-1.6.4-win64.msi installation. However I get following error immediately after starting the program:.
Read more >Python error TypeError: function takes exactly 1 argument (5 ...
file.write() only takes one argument, a string. You've given it five instead: file.write("temperature is ", temperature, ...
Read more >pytorch分布式训练之TypeError: function takes exactly 5 ...
执行以下脚本报错: TypeError: takes exactly 1 argument (2 given) #!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2017-12-18 @author ...
Read more >TypeError: function takes exactly 5 arguments (1 given)
When loading a pristine database with several modules, I got the following error. This error subsequently causes exceptions in all the ...
Read more >distance_from_zero() takes exactly 1 argument (0 given)
TypeError : distance_from_zero() takes exactly 1 argument (0 given) ... 5 votes. Permalink. The first error arises because the function distance_from_zero ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
solved. set num_workers to 0, useful information appeared. PIL image read crashed by non ascii char, some image filename has bad string encode.
Thank you, this helped for me as well. My issue was I was wrongly trying to load a .txt file (label) as an image during training.