Tag Archives: Python practice

No module named ‘google.rpc‘ [How to Solve]

The occurrence of this error is also inexplicable. The error is reported when importing the KFP module after installing the KFP module, but there is no error in its own installation process.

Open KFP to locate the error position:

According to the past experience, after all the troubleshooting, I still can’t find the cause of the error. At this time, I have to open the local Google installation directory. The screenshot is as follows:

It was found that there was no RPC directory. The reason was found. Because I really didn’t want to study more, I created a new virtual environment and installed it. After that, I copied all the modules in Google and copied them to my current Google directory, as shown below:

Re import, solve the problem.

[Solved] RuntimeError: cublas runtime error : resource allocation failed at

[root@bsyocr server-train]# tail trainall210722_6.log.txt
File “/home/server-train/pytorch_pretrained/modeling.py”, line 300, in forward
mixed_query_layer = self.query(hidden_states)
File “/usr/local/lib64/python3.6/site-packages/torch/nn/modules/module.py”, line 547, in __call__
result = self.forward(*input, **kwargs)
File “/usr/local/lib64/python3.6/site-packages/torch/nn/modules/linear.py”, line 87, in forward
return F.linear(input, self.weight, self.bias)
File “/usr/local/lib64/python3.6/site-packages/torch/nn/functional.py”, line 1371, in linear
output = input.matmul(weight.t())
RuntimeError: cublas runtime error : resource allocation failed at /pytorch/aten/src/THC/THCGeneral.cpp:216

RuntimeError: CUDA out of memory. error when running the model Checked a lot of related content, the reason is: GPU memory memory is not enough Briefly summarize the solution: change the batch_size to a smaller size

Modify the pad.size of bert from 2048 -> 1024