Skip to content

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

@nfs2119

Description

@nfs2119

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions