CyberAgentAILab / layout-dm

LayoutDM: Discrete Diffusion Model for Controllable Layout Generation [Inoue+, CVPR2023]
https://cyberagentailab.github.io/layout-dm
Apache License 2.0
211 stars 23 forks source link

Some questions about trainer for a beginner #31

Closed sevenotes closed 8 months ago

sevenotes commented 9 months ago

Hi,I would like to run your code on my computer. I am using the Windows platform, and I have successfully installed the required dependencies. However, I am facing some issues with the 'trainer' module and I am hoping to receive your guidance to resolve them. When I run the code, I'm getting errors in parts where references like 'target: trainer.models.layoutdm.LayoutDM' and 'from trainer' are used. The 'trainer' folder is located under 'src/trainer/'. So, I'm curious why I don't need to use absolute or relative paths to reference them. Is this a feature of Hydra or Poetry?Or could it be a difference between Linux and Windows platforms?

20231221170822

As a beginner who has recently started delving into these topics, I apologize if my question seems naive or silly. Nevertheless, it has been bothering me for quite some time, and I would greatly appreciate your assistance and insights. Thank you very much in advance.

naoto0804 commented 9 months ago

Hi, thank you for your interest in our repo and for reporting many details, which helped me identify the problem faster!

I suspect the dependencies are not properly installed, did you make your env. by conda? Could you check and print the result of the following command?

$ poetry run which python
$ poetry run python -m pip freeze | grep trainer

I'm curious why I don't need to use absolute or relative paths to reference them

If one successfully installs the dependencies, trainer is installed as a package (see packages features in poetry and how we specify in pyproject.toml). As you may know, packaging alleviates some troubles regarding absolute/relative import in Python (see Python Packaging User Guide).

PhucHau0312 commented 8 months ago

Could we train layoutdm on only one of the condition tasks like: c->p+s, c+s->p, refinement, ...., couldn't we ?

naoto0804 commented 8 months ago

@PhucHau0312 Yes, it is possible by keeping the conditional information fixed throughout the forward / reverse process.

PhucHau0312 commented 8 months ago

@PhucHau0312 Yes, it is possible by keeping the conditional information fixed throughout the forward / reverse process.

Thank you. I have one more question that loss of layoutdm combines all condition tasks, right ?

naoto0804 commented 8 months ago

loss of layoutdm combines all condition tasks, right ?

If you optimize the model for a pre-defined set of conditional tasks, the answer is yes.

PhucHau0312 commented 8 months ago

keeping the conditional information fixed throughout the forward / reverse process.

@naoto0804 I didn't see the conditional information argument throughout the training process. Could you show me ?

sevenotes commented 8 months ago

Hi, thank you for your interest in our repo and for reporting many details, which helped me identify the problem faster!

I suspect the dependencies are not properly installed, did you make your env. by conda? Could you check and print the result of the following command?

$ poetry run which python
$ poetry run python -m pip freeze | grep trainer

I'm curious why I don't need to use absolute or relative paths to reference them

If one successfully installs the dependencies, trainer is installed as a package (see packages features in poetry and how we specify in pyproject.toml). As you may know, packaging alleviates some troubles regarding absolute/relative import in Python (see Python Packaging User Guide).

I sincerely appreciate your response. Over the past few days, I installed Ubuntu and made attempts on it. Although the installation of Poetry failed due to my installation of Anaconda, fortunately, this may have helped me identify the issue. I suspect it is a path problem caused by Anaconda, as there were error messages related to it. Even after uninstalling Anaconda, I still encounter related path issues.I will continue my attempts to resolve it. Your answer has been of tremendous help to me as a beginner. I don't know how to express my gratitude, but thank you very much.

naoto0804 commented 8 months ago

Feel free to re-open!