【发布时间】:2018-05-28 22:00:06
【问题描述】:
我正在尝试使用 pix2pixHD 预训练模型生成自己的图像。 Github repo found here
数据集中的图像必须是没有 Alpha 通道的灰度图像。存储库中的图像大小为 16 bitPerSample,我的图像大小为 8 和 16 bitsPerSample。
当我使用sips -g all 检查我的图像和存储库中的图像时。这是我得到的结果:
pixelWidth: 2048
pixelHeight: 1024
typeIdentifier: public.png
format: png
formatOptions: default
dpiWidth: 72.000
dpiHeight: 72.000
samplesPerPixel: 1
bitsPerSample: 16
hasAlpha: no
space: Gray
奇怪的是它适用于具有 8 bitPerSample 的图像。 这是我得到的结果:
当我使用 16 bitsPerSample 图像运行 test.py 时,它不起作用。
这是它给我的错误:
model [Pix2PixHDModel] was created
Traceback (most recent call last):
File "test.py", line 26, in <module>
for i, data in enumerate(dataset):
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 210, in __next__
return self._process_next_batch(batch)
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 230, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
TypeError: Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 42, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/usr/local/lib/python3.5/dist-packages/torch/utils/data/dataloader.py", line 42, in <listcomp>
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/paperspace/Documents/pix2pixHD/data/aligned_dataset.py", line 41, in __getitem__
label_tensor = transform_label(label) * 255.0
File "/usr/local/lib/python3.5/dist-packages/torch/tensor.py", line 309, in __mul__
return self.mul(other)
TypeError: mul received an invalid combination of arguments - got (float), but expected one of:
* (int value)
didn't match because some of the arguments have invalid types: (float)
* (torch.IntTensor other)
didn't match because some of the arguments have invalid types: (float)
我是 Tensorflow 的新手,之前从未使用过 pytorch。
知道这个错误是什么意思,我该如何解决?
【问题讨论】:
-
出于好奇,这需要多长时间来训练?使用 1 个 Tesla k80 GPU 是否有可能在 14 小时内启动并运行?
标签: tensorflow pytorch