训练时出现问题:Creating a tensor from a list of numpy.ndarrays is extremely slow.
- Dominant language
- Python
- Stars
- 36.9k
- Forks
- 5.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Summary[问题简述(一句话)]**
Creating a tensor from a list of numpy.ndarrays is extremely slow.
训练时出现这个,CPU占用率也不高,如何解决
**Env & To Reproduce[复现与环境]**
描述你用的环境、代码版本、模型
**Screenshots[截图(如有)]**
If applicable, add screenshots to help
E:\mockingbird\MockingBird-main\MockingBird-main\synthesizer\synthesizer_dataset.py:84: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_new.cpp:210.)
embeds = torch.tensor(embeds)
E:\mockingbird\MockingBird-main\MockingBird-main\synthesizer\synthesizer_dataset.py:84: UserWarning: Creating a tensor from a list of numpy.ndarrays is extremely slow. Please consider converting the list to a single numpy.ndarray with numpy.array() before converting to a tensor. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\utils\tensor_new.cpp:210.)
embeds = torch.tensor(embeds)
E:\mockingbird\Python\lib\site-packages\torch\nn\functional.py:1933: UserWarning: nn.functional.tanh is deprecated. Use torch.tanh instead.
warnings.warn("nn.functional.tanh is deprecated. Use torch.tanh instead.")
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at synthesizer/synthesizer_dataset.py line 84 and inspect how embeds is assembled during training. Reproduce the warning with the reported training path, then verify that the tensor creation warning and the observed slowdown are addressed without changing the embedding data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python, pytorch
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100