AttributeError: type object 'torch._C.ErrorReport' has no attribute 'call_stack'

wujing: <p>I use the pytorch environment（torch=1.4.0+CU9.2） to train the ASCON model, but when import torch, I get the following error1, which I think is because my torch version is too low, so I copy part of the package from torch1.10.0 into my torch1.4.0 environment to replace it, but the following error2 still occurs:<br>
error1:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/a/9a69086904b995088ffb2c029da6d27816b20cbb.png" data-download-href="https://discuss.pytorch.org/uploads/default/9a69086904b995088ffb2c029da6d27816b20cbb" title="d130b45b1b35428d485e7afe09bd78d"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/a/9a69086904b995088ffb2c029da6d27816b20cbb_2_690x66.png" alt="d130b45b1b35428d485e7afe09bd78d" data-base62-sha1="m1YyRthMgsCZZTjzZ3BG5ZTeWSv" width="690" height="66" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/a/9a69086904b995088ffb2c029da6d27816b20cbb_2_690x66.png, https://discuss.pytorch.org/uploads/default/optimized/3X/9/a/9a69086904b995088ffb2c029da6d27816b20cbb_2_1035x99.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/9/a/9a69086904b995088ffb2c029da6d27816b20cbb.png 2x" data-dominant-color="322F32"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">d130b45b1b35428d485e7afe09bd78d</span><span class="informations">1118×108 13 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
error2:<br>
“C:\Program Files\Anaconda3\envs\torch\python.exe” C:/Users/Administrator/PycharmProjects/ASCON/train.py<br>
Traceback (most recent call last):<br>
File “C:/Users/Administrator/PycharmProjects/ASCON/train.py”, line 2, in <br>
import torch<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch_<em>init</em>_.py”, line 280, in <br>
from .functional import *<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch\functional.py”, line 2, in <br>
import torch.nn.functional as F<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch\nn_<em>init</em>_.py”, line 1, in <br>
from .modules import *<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch\nn\modules_<em>init</em>_.py”, line 23, in <br>
from .rnn import RNNBase, RNN, LSTM, GRU, <br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch\nn\modules\rnn.py”, line 399, in <br>
class LSTM(RNNBase):<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch\nn\modules\rnn.py”, line 523, in LSTM<br>
def forward(self, input, hx=None):  # noqa: F811<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch_jit_internal.py”, line 814, in _overload_method<br>
_check_overload_body(func)<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch_jit_internal.py”, line 746, in _check_overload_body<br>
parsed_def = parse_def(func)<br>
File “C:\Program Files\Anaconda3\envs\torch\lib\site-packages\torch_sources.py”, line 95, in parse_def<br>
sourcelines, file_lineno, filename = get_source_lines_and_file(fn, ErrorReport.call_stack())<br>
AttributeError: type object ‘torch._C.ErrorReport’ has no attribute ‘call_stack’</p>
<p>Due to the hardware limitations of my computer, CUDA can only be installed with version 9.2 and below, so there is no way to directly upgrade the torch environment, I would appreciate it if you could answer my questions</p>

ptrblck: <aside class="quote no-group" data-username="wujing" data-post="1" data-topic="190621">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/w/9de0a6/48.png" class="avatar"> wujing:</div>
<blockquote>
<p>so I copy part of the package from torch1.10.0 into my torch1.4.0 environment to replace it</p>
</blockquote>
</aside>
<p>This doesn’t sound like a good idea as it could create all kinds of conflicts.<br>
Would it possible to update PyTorch instead?</p>