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

What environment is the best to run test.py? #595

Open
nfs2119 opened this issue Jan 13, 2024 · 0 comments
Open

What environment is the best to run test.py? #595

nfs2119 opened this issue Jan 13, 2024 · 0 comments

Comments

@nfs2119
Copy link

nfs2119 commented Jan 13, 2024

I did successfully train the model by connecting it with my dataset from fsoco website. When I run test.py to test the weights model after 20,000 iterations it gives the following error, which I tried to resolve the error using the issue #444. But still this error comes up:


/home/vikram/anaconda3/lib/python3.11/site-packages/torch/init.py:614: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at ../torch/csrc/tensor/python_tensor.cpp:451.)
_C._set_default_tensor_type(t)
/home/vikram/thesis/ssd.pytorch/ssd.py:34: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
self.priors = Variable(self.priorbox.forward(), volatile=True)
Finished loading model!
Testing image 1/57....
Traceback (most recent call last):
File "/home/vikram/thesis/ssd.pytorch/test.py", line 97, in
test_voc()
File "/home/vikram/thesis/ssd.pytorch/test.py", line 92, in test_voc
test_net(args.save_folder, net, args.cuda, testset,
File "/home/vikram/thesis/ssd.pytorch/test.py", line 56, in test_net
y = net(x) # forward pass
^^^^^^
File "/home/vikram/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vikram/anaconda3/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vikram/thesis/ssd.pytorch/ssd.py", line 101, in forward
output = self.detect.apply(self.num_classes, 0, 200, 0.01, 0.45,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/vikram/anaconda3/lib/python3.11/site-packages/torch/autograd/function.py", line 539, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Detect.forward() takes 4 positional arguments but 9 were given
(base) vikram@vikram-OMEN:~/thesis/ssd.pytorch$


Now according to my research, I need a specific pytorch or torch or torchvision version. Can somebody help me in understanding which environment works best to test or evaluate my results? I have created the new environment but am stuck on setup.

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