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

training config #6

Open
Huni0318 opened this issue Dec 23, 2024 · 1 comment
Open

training config #6

Huni0318 opened this issue Dec 23, 2024 · 1 comment

Comments

@Huni0318
Copy link

Traceback (most recent call last):
File "/mnt/tmp/HiCo_T2I/train_hico.py", line 1311, in
main(args)
File "/mnt/tmp/HiCo_T2I/train_hico.py", line 997, in main
train_dataset = make_train_dataset_coco(cfg_data, 'train', accelerator)
File "/mnt/tmp/HiCo_T2I/train_hico.py", line 735, in make_train_dataset_coco
dataset = build_coco_dsets(cfg_data, mode=mode)
File "/mnt/tmp/HiCo_T2I/dataset/coco.py", line 495, in build_coco_dsets
deprecated_coco_stuff_ids_txt=os.path.join(params.root_dir, params[mode].deprecated_stuff_ids_txt),
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 375, in getitem
self._format_and_raise(key=key, value=None, cause=e)
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/base.py", line 231, in _format_and_raise
format_and_raise(
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/_utils.py", line 899, in format_and_raise
_raise(ex, cause)
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/_utils.py", line 797, in _raise
raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 369, in getitem
return self._get_impl(key=key, default_value=DEFAULT_MARKER)
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 442, in _get_impl
node = self._get_child(
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/basecontainer.py", line 73, in _get_child
child = self._get_node(
File "/home/nsml/miniconda3/envs/hico/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 480, in _get_node
raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigKeyError: Missing key train
full_key: data.parameters.train
object_type=dict

**I'm getting an error saying that the train key is missing in the dataset configuration file. How should the dataset be prepared?**

Is the following way of preparing the crop location correct?
python
r_obj_class.insert(0, caption)
r_obj_bbox = np.insert(r_obj_bbox, obj=0, values=[0, 0, 512, 512], axis=0)

cond_image = np.zeros_like(r_image, dtype=np.uint8)

list_cond_image = []
cond_image = np.zeros_like(r_image, dtype=np.uint8)
list_cond_image.append(cond_image)
for iit in range(1, len(r_obj_bbox)):
dot_bbox = r_obj_bbox[iit]
dx1, dy1, dx2, dy2 = [int(xx) for xx in dot_bbox]
cond_image = np.zeros_like(r_image, dtype=np.uint8)
cond_image[dy1:dy2, dx1:dx2] = 255

list_cond_image.append(cond_image)

obj_cond_image = np.stack(list_cond_image, axis=0)
Additionally:

How can I confirm that cond_image is a blank image?

@cbstyle
Copy link
Collaborator

cbstyle commented Dec 26, 2024

Sorry for the problem. The file of utils/dataset/latent_LayoutDiffusion_large_coco.yaml has been fixed. In training phase, the value of condition image is 0/1, in inference phase, the value of condition image is 0/255, please see ./dataset/grit.py

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

2 participants