-
Notifications
You must be signed in to change notification settings - Fork 569
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
I can't run the code you provided. #29
Comments
File "demo.py", line 273, in |
You guys need to modify type(input) as input.type() in roi_pooling.py, line 18 ,then it works. |
ninghongbo123 is right , up |
@ninghongbo123 yes it solved one error but later got other error once we fix this, may i know the pytorch version in which it runs.
|
Figured out that i was using latest pytorch 1.1 and the model has been built on 0.3 so downgraded the package it worked, for anyone trying this out I recommend them to have a environment with below versions strictly so that they wont face any issue. |
@Naveenkhasyap The same error occurred. Can't solve the problem without modifying or reducing the environment? Is there any other way? |
@Naveenkhasyap |
I tried to run demo.py.
Here is the complete code: python demo.py -i ./demo -m ../fh02.pth
But the following error is prompted:
Traceback (most recent call last):
File "demo.py", line 280, in
fps_pred, y_pred = model_conv(x)
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\nn\parallel\data_parallel.py", line 141, in forward
return self.module(*inputs[0], **kwargs[0])
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\nn\modules\module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "demo.py", line 210, in forward
roi1 = roi_pooling_ims(_x1, boxNew.mm(p1), size=(16, 8))
File "D:\Development\DevelopmentProject\Python\CCPD-master\rpnet\roi_pooling.py", line 73, in roi_pooling_ims
output.append(adaptive_max_pool(im, size))
File "D:\Development\DevelopmentProject\Python\CCPD-master\rpnet\roi_pooling.py", line 35, in adaptive_max_pool
return AdaptiveMaxPool2d(size[0], size[1])(input)
File "D:\Development\DevelopmentProject\Python\CCPD-master\rpnet\roi_pooling.py", line 18, in forward
self.backend = type2backend[type(input)]
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch_thnn_init.py", line 15, in getitem
return self.backends[name].load()
KeyError: <class 'torch.Tensor'>
I run: python wR2.py -i ./CCPD_2019/CCPD2019 -b 4
The following error occurred:
Traceback (most recent call last):
File "wR2.py", line 226, in
trainloader = DataLoader(dst, batch_size=batchSize, shuffle=True, num_workers=4)
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 802, in init
sampler = RandomSampler(dataset)
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\utils\data\sampler.py", line 64, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integeral value, but got num_samples=0
I run python rpnet.py -i ./CCPD_2019/CCPD2019 -b 4 -se 0 -f ./wR2 -t ./demo
and error:
Traceback (most recent call last):
File "rpnet.py", line 406, in
trainloader = DataLoader(dst, batch_size=batchSize, shuffle=True, num_workers=8)
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 802, in init
sampler = RandomSampler(dataset)
File "D:\Development\DevelopmentEnvironment\Miniconda3\lib\site-packages\torch\utils\data\sampler.py", line 64, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integeral value, but got num_samples=0
Can you help me solve this problem? I will appreciate your help very much.
The text was updated successfully, but these errors were encountered: