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

TypeError: function takes exactly 5 arguments (1 given)如何解决呀? #165

Open
LKCN opened this issue Oct 3, 2020 · 4 comments
Open

Comments

@LKCN
Copy link

LKCN commented Oct 3, 2020

Traceback (most recent call last):
File "E:/WangJianFeng/2020/TextDetection/PSENet/train_ic15.py", line 285, in
main(args)
File "E:/WangJianFeng/2020/TextDetection/PSENet/train_ic15.py", line 253, in main
train_loss, train_te_acc, train_ke_acc, train_te_iou, train_ke_iou = train(train_loader, model, dice_loss, optimizer, epoch)
File "E:/WangJianFeng/2020/TextDetection/PSENet/train_ic15.py", line 112, in train
for batch_idx, (imgs, gt_texts, gt_kernels, training_masks) in enumerate(train_loader):
File "D:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next
data = self._next_data()
File "D:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data
return self._process_data(data)
File "D:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data
data.reraise()
File "D:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch_utils.py", line 395, in reraise
raise self.exc_type(msg)
TypeError: function takes exactly 5 arguments (1 given)

@BigWhit
Copy link

BigWhit commented Nov 29, 2020

I met the same problem. Did you fix it?

@RoseSakurai
Copy link
Collaborator

看起来像是dataloader有问题,请帖上更多代码或者自己查查看。

@As-David
Copy link

检查一下checkpoint和图片路径是否正确,把num_worker设置成0试试

@wlsh1up
Copy link

wlsh1up commented Jun 25, 2021

同样的问题已经解决.
搜索的是docker引起的莫名其妙的错误. 可能是我用的集群分给给每个用户是docker虚拟出来的
解决方法:

PSENet/train.py

Line 158 in 4d95395

num_workers=8,

改为 num_workers=0

运行后出现另外一个新错误.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
卸载旧版本mmcv,安装最新版本的mmcv即可
pip uninstall mmcv
pip install mmcv

解决完后,就能正常运行了..然后把num_worker改为gpu_num整数倍也没问题了

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

5 participants