Solution: volatile was removed and now has no effect. Use
self.priors = Variable(self.priorbox.forward(), volatile=True)
It volatilehas been removed in the torch version .
Before pytorch 0.4.0 input = Variable(input, volatile=True) set volatile to True, as long as an input is volatile, the output is also volatile, which can guarantee that there is no intermediate state; but canceled after pytorch 0.4.0 The volatile mechanism is replaced with functions such as torch.no_grad(), torch.set_grad_enable(grad_mode)
torch.no_grad() is a context manager.
When using pytorch , not all operations require the generation of calculation graphs (the construction of the calculation process to facilitate gradient back propagation and other operations). For the calculation operation of tensor, the default is to construct the calculation graph. In this case, you can use with torch.no_grad(): to force the subsequent content not to construct the calculation graph.
The torch.no_grad() will affect pytorch’s backpropagation mechanism. In the test, because it is determined that backpropagation will not be used, this mode can help save memory space. The same is true for torch.set_grad_enable(grad_mode)
with torch.no_grad(): self.priors = Variable(self.priorbox.forward())
self.priors = Variable(self.priorbox.forward())
- Libtorch Error: Expected object of type Variable but found type CUDALongType for argument #2 ‘index’
- RuntimeError: Integer division of tensors using div or / is no longer supported, and in a future rel
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib
- Error in Tensorflow using variables: List of Tensors when single Tensor expected
- Pytorch failed to specify GPU resolution
- RuntimeError: ONNX export failed: Couldn‘t export operator aten::upsample_bilinear2d
- Deep learning model error + 1: CUDA error: device side assert triggered
- TypeError: db.collection is not a function
- C++ Error: terminating with uncaught exception of type std::out_of_range: vector Abort trap: 6
- Filezilla Error: You appear to be behind a NAT router. Please configure the passive mode settings and …
- ValueError: Floating point image RGB values must be in the 0..1 range.
- NVM ERROR open \settings.txt: The system cannot find the file specified
- postman Error:There was an error connecting to XXXX
- Angular_ Error: Cannot assign to a reference or variable!
- 500 (International server error) server error in Flash + heroku
- GCC error: unrecognized command line option ‘-no-pie’
- Numpy.exp Function Error ‘Float’ object has no attribute ‘exp’
- A mistake about implicitly providing default constructors
- Spark-SQL Error: A JNI error has occurred, please check your installation and try again Exceptio
- Keil’s duplicate definition problem: Error: L6200E: Symbol F6x8 multiply defined