有没有考虑升级一下,在python=3.10中有些运行出错,python3.6太老了

Aperta
#64 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
numpy, python, pytorch

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

(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 #

Lingua principale
Python
Stelle
8k
Fork
1.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TingsongYu/PyTorch_Tutorial

Tutte le issue di TingsongYu/PyTorch_Tutorial

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.