Closed songwaimai closed 5 years ago
You need to cast tensor to float type,
RACNN.py
@@ -77,6 +76,8 @@ class AttentionCropFunction(torch.autograd.Function):
unit = torch.stack([torch.arange(0, in_size)] * in_size)
x = torch.stack([unit.t()] * 3)
y = torch.stack([unit] * 3)
+ x = x.float()
+ y = y.float()
哇,谢谢,我已经这么做了,程序也通了,但是运行trainer后出现了这个 /usr/bin/python2.7 /home/dl2/Songly/RACNN-pytorch-master/trainer.py [] Set cuda: True [] Loading dataset...
Process finished with exit code 134 (interrupted by signal 6: SIGABRT) 不知道是为什么呢,期待您的回答 @hubutui
@songwaimai yep. he is right. You may need to cast tensor. and... i don't know your characters. can you translate in English?
I am really sorry about progress. I am focusing on the other project now. Here i already aware about some issues. I will fix and improve when i convenient.
please keep follow repo and me to know when it's update. Thank you!
Thank you very much for answering my question~ the question has been resolved. i am a newbie of pytorch :-) now the new error happened. when i run trainer.py line235 # response_map = F.upsample(response_map, size=[resize, resize])
[] Set cuda: True
[] Loading dataset...
/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py:1890: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
Traceback (most recent call last):
File "/home/dl2/Songly/RACNN-pytorch-master/trainer.py", line 318, in
Process finished with exit code 1 i don't know why~ i am looking forward your answer~
nn.functional.upsample is deprecated. Use nn.functional.interpolate instead
this log is clear enough. And the arg/param changed a little, see torch.nn.functional.interpolate for detail.
PS: discussion in English helps others understand you and reply to your issue.
ok,thank U very much. Now the program can run! I appreciate it~
Seems solved issue. I will close it. If you have new question or find bug, please make new issue
ok,thank U very much. Now the program can run! I appreciate it~
hi, I run the code recently. Now I have the question like this even I used nn.functional.interpolate instead.
I change the line230 "response_map = F.upsample(response_map, size = [resize, resize])" into response_map = F.interpolate(response_map, size=(resize, resize)), but it doesn't work. How can I solve it? Thanks in advance.
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 399, in del
self._shutdown_workers()
File "C:\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 378, in _shutdown_workers
self.worker_result_queue.get()
File "C:\Anaconda3\lib\multiprocessing\queues.py", line 345, in get
return ForkingPickler.loads(res)
File "C:\Anaconda3\lib\site-packages\torch\multiprocessing\reductions.py", line 167, in rebuild_storage_filename
storage = cls._new_shared_filename(manager, handle, size)
RuntimeError: Couldn't open shared event:
Process finished with exit code 1
You need to cast tensor to float type,
RACNN.py @@ -77,6 +76,8 @@ class AttentionCropFunction(torch.autograd.Function): unit = torch.stack([torch.arange(0, in_size)] * in_size) x = torch.stack([unit.t()] * 3) y = torch.stack([unit] * 3) + x = x.float() + y = y.float()
Hi, I changed it like you. But it doesn't work. The error like this
Traceback (most recent call last):
File "L:/project/RACNN-pytorch-master/models/RACNN.py", line 176, in
How can I solve it? Thank you in advance
I solve the problem:
@songwaimai Hi , did you obtain the performance mentioned in the origin paper using this code?
@songwaimai hi,How to solve your second problem? I change the code to 'response_map = f.interpolate (response_map, size = [resize, resize])' , but the same error will be reported
Thank you for you guys attention to this repo. I've updated to solve many issues. probably, many errors come from changing of pytorch version and I update few lines. I hope this helps you guys!
I will update more soon if possible. Unfortunately and fortunately Coronavirus19 makes me stay home more and it leads me to fix this repo.
Keep letting me know if there is a problem!
[] RACNN forward test... Traceback (most recent call last): File "/home/dl2/Songly/RACNN-pytorch-master/models/RACNN.py", line 158, in
logits, conv5s, attens = net(x)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward( input, kwargs)
File "/home/dl2/Songly/RACNN-pytorch-master/models/RACNN.py", line 49, in forward
scaledA_x = self.crop_resize(x, atten1 448)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(input, kwargs)
File "/home/dl2/Songly/RACNN-pytorch-master/models/RACNN.py", line 152, in forward
return AttentionCropFunction.apply(images, locs)
File "/home/dl2/Songly/RACNN-pytorch-master/models/RACNN.py", line 99, in forward
mk = (h(x-w_off) - h(x-w_end)) (h(y-h_off) - h(y-h_end))
File "/home/dl2/Songly/RACNN-pytorch-master/models/RACNN.py", line 76, in
h = lambda x: 1 / (1 + torch.exp(-10 x))
RuntimeError: "exp" not implemented for 'torch.LongTensor'