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

关于元组不能被用做整数 #17

Open
go1314 opened this issue Jul 11, 2023 · 0 comments
Open

关于元组不能被用做整数 #17

go1314 opened this issue Jul 11, 2023 · 0 comments

Comments

@go1314
Copy link

go1314 commented Jul 11, 2023

File "D:\go\code\segformer-pytorch-master\segformer-pytorch-master\train.py", line 237, in
cls_weights = np.ones([num_classes], np.float32)
File "F:\anaconda\envs\segformer\lib\site-packages\numpy\core\numeric.py", line 214, in ones
a = empty(shape, dtype, order)
TypeError: 'tuple' object cannot be interpreted as an integer

作者大大你好,我改用自己的数据训练模型,在train.py的cls_weights = np.ones([num_classes], np.float32)出现了问题。我是二分类问题。

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

1 participant