Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用AFHQ数据集训练模型 #42

Open
zhangqian001 opened this issue Oct 7, 2022 · 13 comments
Open

使用AFHQ数据集训练模型 #42

zhangqian001 opened this issue Oct 7, 2022 · 13 comments

Comments

@zhangqian001
Copy link

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

@imlixinyang
Copy link
Owner

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

@zhangqian001
Copy link
Author

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

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

@imlixinyang
Copy link
Owner

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

@zhangqian001
Copy link
Author

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

image

@irine1210
Copy link

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

@zhangqian001
Copy link
Author

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

并没有解决,抱歉哈。

@imlixinyang
Copy link
Owner

imlixinyang commented Oct 19, 2022 via email

@zhangqian001
Copy link
Author

请稍等哈 我一会看一下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: @.***>

好的好的,非常感谢。

@imlixinyang
Copy link
Owner

imlixinyang commented Oct 19, 2022

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

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

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

@zhangqian001
Copy link
Author

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

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

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

@zhangqian001
Copy link
Author

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

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

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

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

@imlixinyang
Copy link
Owner

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

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

@zhangqian001
Copy link
Author

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

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants