texturedesign / texturize

🤖🖌️ Generate photo-realistic textures based on source images or (soon) PBR materials. Remix, remake, mashup! Useful if you want to create variations on a theme or elaborate on an existing texture.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using --variations > 1 fails`

anderslanglands opened this issue · comments

I'm running:

texturize remix Bricks075A_1K_Color.png --size 2048x1024 --device=cuda --variations=2

Seems like using --variations anything other than 1 causes the following almost immediately:

 OCTAVE #0
Traceback (most recent call last):
  File "/home/anders/miniconda3/envs/texturize_dev/bin/texturize", line 5, in <module>
    main()
  File "/home/anders/code/texturize/src/texturize/__main__.py", line 178, in main
    result, filenames = api.process_single_command(cmd, log, **config)
  File "/home/anders/code/texturize/src/texturize/api.py", line 99, in process_single_command
    for result in process_octaves(cmd, log=log, **config):
  File "/home/anders/miniconda3/envs/texturize_dev/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in generator_context
    x = next(gen)
  File "/home/anders/code/texturize/src/texturize/api.py", line 89, in process_octaves
    for r in process_iterations(cmd, **kwargs):
  File "/home/anders/miniconda3/envs/texturize_dev/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in generator_context
    x = next(gen)
  File "/home/anders/code/texturize/src/texturize/api.py", line 68, in process_iterations
    for result in app.process_octave(
  File "/home/anders/code/texturize/src/texturize/app.py", line 130, in process_octave
    for iteration, (loss, result_img, lr, retries) in enumerate(
  File "/home/anders/code/texturize/src/texturize/app.py", line 40, in run
    yield from self._run(progress, seed_img, *args, objective_class=oc, solver_class=sc)
  File "/home/anders/code/texturize/src/texturize/app.py", line 65, in _run
    for i, loss, converge, lr, retries in self._iterate(opt):
  File "/home/anders/code/texturize/src/texturize/app.py", line 85, in _iterate
    loss, scores = opt.step()
  File "/home/anders/code/texturize/src/texturize/solvers.py", line 84, in step
    self.optimizer.step(self.call_objective)
  File "/home/anders/miniconda3/envs/texturize_dev/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context
    return func(*args, **kwargs)
  File "/home/anders/miniconda3/envs/texturize_dev/lib/python3.8/site-packages/torch/optim/lbfgs.py", line 311, in step
    orig_loss = closure()
  File "/home/anders/miniconda3/envs/texturize_dev/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 15, in decorate_context
    return func(*args, **kwargs)
  File "/home/anders/code/texturize/src/texturize/solvers.py", line 51, in call_objective
    loss, scores = self.objective(self.image)
  File "/home/anders/code/texturize/src/texturize/solvers.py", line 164, in __call__
    for loss in critic.evaluate(feats):
  File "/home/anders/code/texturize/src/texturize/critics.py", line 169, in evaluate
    self.matcher.update_target(target)
  File "/home/anders/code/texturize/src/texturize/match.py", line 267, in update_target
    assert target.shape[0] == 1
AssertionError
iter: None | loss: inf |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% | elapsed: 0:00:00

This should be more reliable now the default is mode='hist'. Previously, any command relying on mode='patch' would fail with variations. The patch search still only works with one variation at a time, but it's no longer default.