【问题标题】:Feeding only images in Chainer model在 Chainer 模型中仅提供图像
【发布时间】:2019-05-16 16:18:23
【问题描述】:

我有一个仅包含图像的数据集,这些图像将在自动编码器中用于重新生成输入图像。我想使用链接器 ImageDataset 将数据提供给迭代器。

data = test_tup = chainer.datasets.ImageDataset('/NewText.txt', '/train')

我已经给出了包含图像地址的文本文件的地址,并在根目录中给出了保存图像的文件夹的地址。

 79         _check_pillow_availability()
 80         if isinstance(paths, six.string_types):
---> 81             with open(paths) as paths_file:
 82                 paths = [path.strip() for path in paths_file]
 83         self._paths = paths

FileNotFoundError: [Errno 2] No such file or directory: '/NewText.txt'

这是使用 ImageDataset 的正确方法吗?另外我想知道 ImageDataset 是只输入图像的好选择还是有其他选择。

【问题讨论】:

    标签: image-processing dataset chainer


    【解决方案1】:

    我猜测路径可能与您的预期不同。 print(paths) 可能有助于确定问题。

    datasets.LabeledImageDataset() 可能会更好。有关导入的示例,请查看此处:https://github.com/chainer/chainer/blob/v5.4.0/examples/imagenet/train_imagenet.py

    希望对你有帮助,

    【讨论】:

    • 嗨,Crissman Loomis.. 5 个月前开始使用您的视频学习 chainer。言归正传……我的数据集用于无监督学习,仅包含图像,没有标签。
    • 啊,明白了。那么是的,ImageDataset 似乎是合适的。希望是路径问题。
    猜你喜欢
    • 1970-01-01
    • 2019-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多