我正在尝试在 Nvidia Jetson Nano 2 上导入 pytorch,但我面临以下问题。我使用的 pytorch 版本是 1.10.0,带有 torchvision 0.11.1 和 torchtext 0.6.0(如果相关)
我尝试了以下方法:
- 更改导入顺序
- 导出 $LD_PRELOAD='/home/msc/.local/lib/python3.6/site-packages/torch/lib/libgomp-d22c30c5.so.1' 后跟源 ~/.bashrc。
2 import math
3 import numpy as np
----> 4 import torch
5 import torch.nn as nn
6 import torch.nn.functional as F
~/.local/lib/python3.6/site-packages/torch/__init__.py in <module>
194 # See Note [Global dependencies]
195 if USE_GLOBAL_DEPS:
--> 196 _load_global_deps()
197 from torch._C import * # noqa: F403
198
~/.local/lib/python3.6/site-packages/torch/__init__.py in _load_global_deps()
147 lib_path = os.path.join(os.path.dirname(here), 'lib', lib_name)
148
--> 149 ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
150
151
/usr/lib/python3.6/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
346
347 if handle is None:
--> 348 self._handle = _dlopen(self._name, mode)
349 else:
350 self._handle = handle
/home/msc/.local/lib/python3.6/site-packages/torch/lib/libgomp-d22c30c5.so.1: cannot allocate memory in static TLS block
但是,错误仍然存在。我真的很感激任何帮助!
这是磁盘空间的描述,以防万一。
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p1 30G 24G 4.7G 84% /
none 947M 0 947M 0% /dev
tmpfs 986M 92K 986M 1% /dev/shm
tmpfs 986M 21M 966M 3% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 986M 0 986M 0% /sys/fs/cgroup
tmpfs 198M 8.0K 198M 1% /run/user/1000
谢谢!