In pl.lightningmodule, Spacy cannot be used for word segmentation, or an error will be reported
1. Use in the forward process
...
File "spacy/pipeline/trainable_pipe.pyx", line 75, in spacy.pipeline.trainable_pipe.TrainablePipe.pipe
...
It is possible that all objects in the model are automatically transformed into trainable objects within the PL framework. Similarly, if the original pipe is also transformed into trainablepipe, an error will be reported, including an error as shown above
2. Avoid problem 1 and use nlp.pipe
Similarly, the same problem as in forward will be converted to a trainable pipe
3. To avoid problem 1, write Spacy processing outside the model as a function call
The same error will be reported. The error is different from the above. It is a very inexplicable error
Solution:
I didn’t find a good solution, so I had to rewrite the required functions manually, such as stopping words
Read More:
- [Solved] PyTorch Lightning Error: KeyError: ‘hidden_states‘
- Pytorch ValueError: Expected more than 1 value per channel when training, got input size [1, 768
- Pytorch: error message with chunks of 0 [How to Solve]
- pytorch model.load_state_dict Error [How to Solve]
- [Pytorch Error Solution] Pytorch distributed RuntimeError: Address already in use
- Pytorch Run Error: BrokenPipeError [How to Solve]
- Pytorch directly creates a tensor on the GPU error [How to Solve]
- [CUDA Environment] Python Pytorch Error: CudaSetupArgument
- Pytorch Error: RuntimeError: value cannot be converted to type float without overflow: (0.00655336,-0.00
- [Solved] PyTorch Error: TypeError: exceptions must derive from BaseException
- [Solved] pytorch Error: KeyError: tensor(2, device=‘cuda:0‘)
- Install PyTorch in Anaconda environment
- [Solved] RuntimeError : PyTorch was compiled without NumPy support
- [Solved] Pytorch-transformers Error: AttributeError: ‘str‘ object has no attribute ‘shape‘
- How to Solve Pytorch eval Stuck Error
- [Solved] Pytorch error: RuntimeError: one of the variables needed for gradient computation
- [Solved] bushi RuntimeError: version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at /pytorch/caffe2/s
- [Solved] PyTorch Caught RuntimeError in DataLoader worker process 0和invalid argument 0: Sizes of tensors mus
- Pytorch Error: runtimeerror: expected scalar type double but found float
- pytorch: RuntimeError CUDA error device-side assert triggered