解决tensor.sub_(mean).div_(std)RuntimeError: output with shape [1, 28, 28] doesn‘t match the broadcas(
Posted 沉迷单车的追风少年
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了解决tensor.sub_(mean).div_(std)RuntimeError: output with shape [1, 28, 28] doesn‘t match the broadcas(相关的知识,希望对你有一定的参考价值。
项目场景:
MNIST数据集 GANs生成
问题描述:
完整报错:
Traceback (most recent call last):
File "pytorch_MNIST_cGAN.py", line 229, in <module>
for x_, y_ in train_loader:
File "/root/anaconda3/envs/dpm-pc-gen/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
data = self._next_data()
File "/root/anaconda3/envs/dpm-pc-gen/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/root/anaconda3/envs/dpm-pc-gen/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/anaconda3/envs/dpm-pc-gen/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py
以上是关于解决tensor.sub_(mean).div_(std)RuntimeError: output with shape [1, 28, 28] doesn‘t match the broadcas(的主要内容,如果未能解决你的问题,请参考以下文章
解决tensor.sub_(mean).div_(std)RuntimeError: output with shape [1, 28, 28] doesn‘t match the broadcas(
Codeforces Round #723 (Div. 2) A. Mean Inequality(构造)