imlixinyang / HiSD

Official pytorch implementation of paper "Image-to-image Translation via Hierarchical Style Disentanglement" (CVPR 2021 Oral).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

使用AFHQ数据集训练模型

zhangqian001 opened this issue · comments

commented

您好,我使用AFHQ数据集训练模型。在使用preprocessors文件夹的custom.py的时候,报错'Namespace'object has no attribute 'imgs',在参数定义中也没看见--imgs定义。请问这块该怎么改呢,谢谢谢谢。

之前的变量名有误,已经修正了,烦请重新试下~

commented

之前的变量名有误,已经修正了,烦请重新试下~

非常感谢,现在没报错了,但是生成的三个txt文件是空的。

你发一下afhq下文件的tree形式,可能是因为文件夹结构。

commented

你发一下afhq下文件的tree形式,可能是因为文件夹结构。

image

同问,请问楼主是否已经解决了?如何解决该问题的?

commented

同问,请问楼主是否已经解决了?如何解决该问题的?

并没有解决,抱歉哈。

commented

请稍等哈 我一会看一下afhq文件目录后答复你们解决方法 Sent from my iPhone

------------------ 原始邮件 ------------------ From: GAN @.> 发送时间: 10/19/2022, 10:02 To: imlixinyang/HiSD @.> 抄送: imlixinyang @.>, Comment @.> Subject: Re: [imlixinyang/HiSD] 使用AFHQ数据集训练模型 (Issue #42) 同问,请问楼主是否已经解决了?如何解决该问题的? 并没有解决,抱歉哈。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

好的好的,非常感谢。

img_path一定要保证它是图片文件的上上上级目录哦,也就是应该是img_path/tag/attribute/*.jpg。AFHQ没有Tag的概念,因此可以新建一个文件夹叫species,然后按照以下路径存放:

- afhq
  - train
    - species
      - cat
        - *.jpg
      - dog
      - wild
  - test

然后指定image_path为afhq/train即可。

commented

img_path一定要保证它是图片文件的上上上级目录哦,也就是应该是img_path/tag/attribute/*.jpg。AFHQ没有Tag的概念,因此可以新建一个文件夹叫species,然后按照以下路径存放:

- afhq
  - train
    - species
      - cat
        - *.jpg
      - dog
      - wild
  - test

然后指定image_path为afhq/train即可。
好的,非常感谢,非常感谢。

commented

img_path一定要保证它是图片文件的上上上级目录哦,也就是应该是img_path/tag/attribute/*.jpg。AFHQ没有Tag的概念,因此可以新建一个文件夹叫species,然后按照以下路径存放:

- afhq
  - train
    - species
      - cat
        - *.jpg
      - dog
      - wild
  - test

然后指定image_path为afhq/train即可。

非常感谢您,但是生成的txt文件仍然为空的。我再看下for循环里面有什么要改的吧,问题可能出在这里。

我检查了一下 貌似是这里写错了 我修改了一下 你pull了再试试:

if os.path.isfile(os.path.join(opts.imgs, tag_dir, attribute_dir, image)):

commented

我检查了一下 貌似是这里写错了 我修改了一下 你pull了再试试:

if os.path.isfile(os.path.join(opts.imgs, tag_dir, attribute_dir, image)):

好的好的,已经成功运行了,非常感谢。