3

I try to train with my custom dataset that shape 256x256 This is stylegan2 code : https://github.com/NVlabs/stylegan2.git

I prepared dataset with this command :

!mkdir dataset
!tar -xf data.tar
!python dataset_tool.py create_from_images_raw ./dataset/mydataset data

and I used this command to start training in colab :

!python run_training.py --num-gpus=1 --data-dir=dataset --config=config-f --dataset=mydataset --mirror-augment=true --result-dir="/content/drive/My Drive/results"

and stylegan2 is crashed with this error

tcmalloc: large alloc 1509949440 bytes == 0x562e619ec000 @  0x7f26bf0fa1e7 0x7f26bbbe046e 0x7f26bbc30c7b 0x7f26bbc3135f 0x7f26bbcd3103 0x562da47a3010 0x562da47a2da0 0x562da48172f9 0x562da4811dcc 0x562da47a473a 0x562da4812b0e 0x562da4812235 0x562da47a473a 0x562da481393b 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da47a465a 0x562da4812b0e 0x562da47a465a 0x562da4812d67 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da47a465a 0x562da4812b0e 0x562da4811c35 0x562da4811933
tcmalloc: large alloc 1509949440 bytes == 0x562ef7b5c000 @  0x7f26bf0fc001 0x7f26bbbe054f 0x7f26bbc30b58 0x7f26bbc34b17 0x7f26bbcd3203 0x562da47a30a4 0x562da47a2da0 0x562da4817868 0x562da4811c35 0x562da47a473a 0x562da4812b0e 0x562da4811c35 0x562da47a473a 0x562da481393b 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da47a465a 0x562da4812b0e 0x562da47a465a 0x562da4812d67 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da47a465a 0x562da4812b0e 0x562da4811c35 0x562da4811933
tcmalloc: large alloc 1509949440 bytes == 0x562f51b5c000 @  0x7f26bf0fa1e7 0x7f26bbbe046e 0x7f26bbc30c7b 0x7f26bbc30d18 0x7f26bbcecd79 0x7f26bbcefe4c 0x7f26bbe0ee7f 0x7f26bbe14fb5 0x7f26bbe16e3d 0x7f26bbe18516 0x562da47a4280 0x562da47a3e59 0x7f26bbcf6e6b 0x562da488c377 0x562da4813c30 0x562da47a465a 0x562da4812b0e 0x562da4811c35 0x562da47a473a 0x562da4812b0e 0x562da4811c35 0x562da47a473a 0x562da481393b 0x562da4811c35 0x562da46e3e2c 0x562da4814318 0x562da47a465a 0x562da4812b0e 0x562da47a465a 0x562da4812d67 0x562da4811c35
Building TensorFlow graph...
Traceback (most recent call last):
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 642, in set_shape
    unknown_shape)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Dimension 2 in both shapes must be equal, but are 256 and 512. Shapes are [?,3,256,256] and [?,3,512,512].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "run_training.py", line 222, in <module>
    main()
  File "run_training.py", line 217, in main
    run(**vars(args))
  File "run_training.py", line 137, in run
    dnnlib.submit_run(**kwargs)
  File "/content/stylegan2/dnnlib/submission/submit.py", line 343, in submit_run
    return farm.submit(submit_config, host_run_dir)
  File "/content/stylegan2/dnnlib/submission/internal/local.py", line 22, in submit
    return run_wrapper(submit_config)
  File "/content/stylegan2/dnnlib/submission/submit.py", line 280, in run_wrapper
    run_func_obj(**submit_config.run_func_kwargs)
  File "/content/stylegan2/training/training_loop.py", line 233, in training_loop
    D_loss, D_reg = dnnlib.util.call_func_by_name(G=G_gpu, D=D_gpu, opt=D_opt, training_set=training_set, minibatch_size=minibatch_gpu_in, reals=reals_read, labels=labels_read, **D_loss_args)
  File "/content/stylegan2/dnnlib/util.py", line 256, in call_func_by_name
    return func_obj(*args, **kwargs)
  File "/content/stylegan2/training/loss.py", line 56, in D_logistic_r1
    real_scores_out = D.get_output_for(reals, labels, is_training=True)
  File "/content/stylegan2/dnnlib/tflib/network.py", line 221, in get_output_for
    out_expr = self._build_func(*final_inputs, **build_kwargs)
  File "/content/stylegan2/training/networks_stylegan2.py", line 792, in D_stylegan2
    images_in.set_shape([None, num_channels, min_h*2**res_log2, min_w*2**res_log2])
  File "/tensorflow-1.15.2/python3.7/tensorflow_core/python/framework/ops.py", line 645, in set_shape
    raise ValueError(str(e))
ValueError: Dimension 2 in both shapes must be equal, but are 256 and 512. Shapes are [?,3,256,256] and [?,3,512,512].

What did I do wrong?

SEAN
  • 31
  • 2

0 Answers0