TingsongYu / TingsongYu/PyTorch_Tutorial
有没有考虑升级一下,在python=3.10中有些运行出错,python3.6太老了
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Description
(my_torch) root@/mac 4_viewer # python 1_tensorboardX_demo.py
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.2.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "/Users/rhf/Documents/robot/my_torch/PyTorch_Tutorial/Code/4_viewer/1_tensorboardX_demo.py", line 3, in
import torch
File "/my_torch/lib/python3.10/site-packages/torch/init.py", line 1477, in
from .functional import * # noqa: F403
File "/my_torch/lib/python3.10/site-packages/torch/functional.py", line 9, in
import torch.nn.functional as F
File "/my_torch/lib/python3.10/site-packages/torch/nn/init.py", line 1, in
from .modules import * # noqa: F403
File "/my_torch/lib/python3.10/site-packages/torch/nn/modules/init.py", line 35, in
from .transformer import TransformerEncoder, TransformerDecoder,
File "/my_torch/lib/python3.10/site-packages/torch/nn/modules/transformer.py", line 20, in
device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'),
/my_torch/lib/python3.10/site-packages/torch/nn/modules/transformer.py:20: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at /Users/runner/work/pytorch/pytorch/pytorch/torch/csrc/utils/tensor_numpy.cpp:84.)
device: torch.device = torch.device(torch._C._get_default_device()), # torch.device('cpu'),
/my_torch/lib/python3.10/site-packages/torchvision/models/_utils.py:135: UserWarning: Using 'weights' as positional parameter(s) is deprecated since 0.13 and may be removed in the future. Please use keyword parameter(s) instead.
warnings.warn(
/my_torch/lib/python3.10/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=None.
warnings.warn(msg)
Traceback (most recent call last):
File "/Users/rhf/Documents/robot/my_torch/PyTorch_Tutorial/Code/4_viewer/1_tensorboardX_demo.py", line 27, in
writer.add_scalar(os.path.join("data", "scalar_systemtime"), s1[0], n_iter)
File "/my_torch/lib/python3.10/site-packages/tensorboardX/writer.py", line 456, in add_scalar
scalar(tag, scalar_value, display_name, summary_description), global_step, walltime)
File "/my_torch/lib/python3.10/site-packages/tensorboardX/summary.py", line 152, in scalar
scalar = make_np(scalar)
File "/my_torch/lib/python3.10/site-packages/tensorboardX/x2num.py", line 28, in make_np
return check_nan(prepare_pytorch(x))
File "/my_torch/lib/python3.10/site-packages/tensorboardX/x2num.py", line 43, in prepare_pytorch
x = x.cpu().numpy()
RuntimeError: Numpy is not available
(my_torch) root@/mac 4_viewer #
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Code/4_viewer/1_tensorboardX_demo.py and reproduce the reported failure under Python 3.10, noting the NumPy, PyTorch, and torchvision warnings in the traceback. Review the project’s dependency guidance or configuration, then verify that the demo runs without the “Numpy is not available” error on the supported Python version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100