You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your work @MoyGcc and sorry to bother you because my pytorch and deep learning knowledge is quite basic.
After running into some issues details in #13, I'm now able to run train.py. It's now around epoch 700 and I wonder if I'm supposed to let it run until the max epochs defined in train.py e.g 8000 ?
However I tried to run test.py with this trained model at epoch 700. But it complains about element 0 of tensors does not require grad and does not have a grad_fn with the following output:
/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/connectors/accelerator_connector.py:479: LightningDeprecationWarning: Setting `Trainer(gpus=1)` is deprecated in v1.7 and will be removed in v2.0. Please use `Trainer(accelerator='gpu', devices=1)` instead.
f"Setting `Trainer(gpus={gpus!r})` is deprecated in v1.7 and will be removed"
GPU available: True (cuda), used: True
TPU available: False, using: 0 TPU cores
IPU available: False, using: 0 IPUs
HPU available: False, using: 0 HPUs
Restoring states from the checkpoint path at checkpoints/last.ckpt
LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]
Loaded model weights from checkpoint at checkpoints/last.ckpt
Testing DataLoader 0: 0%| | 0/42 [00:00<?, ?it/s]/home/vizua/vid2avatar/code/v2a_model.py:219: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
1) // pixel_per_batch
/home/vizua/vid2avatar/code/lib/utils/meshing.py:49: FutureWarning: marching_cubes_lewiner is deprecated in favor of marching_cubes. marching_cubes_lewiner will be removed in version 0.19
level=level_set)
Error executing job with overrides: []
Traceback (most recent call last):
File "test.py", line 39, in <module>
main()
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/main.py", line 99, in decorated_main
config_name=config_name,
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/_internal/utils.py", line 401, in _run_hydra
overrides=overrides,
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/_internal/utils.py", line 458, in _run_app
lambda: hydra.run(
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/_internal/utils.py", line 223, in run_and_report
raise ex
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/_internal/utils.py", line 220, in run_and_report
return func()
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/_internal/utils.py", line 461, in <lambda>
overrides=overrides,
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 132, in run
_ = ret.return_value
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/core/utils.py", line 260, in return_value
raise self._return_value
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/hydra/core/utils.py", line 186, in run_job
ret.return_value = task_function(task_cfg)
File "test.py", line 36, in main
trainer.test(model, testset, ckpt_path=checkpoint)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 795, in test
self, self._test_impl, model, dataloaders, ckpt_path, verbose, datamodule
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/call.py", line 38, in _call_and_handle_interrupt
return trainer_fn(*args, **kwargs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 842, in _test_impl
results = self._run(model, ckpt_path=self.ckpt_path)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1112, in _run
results = self._run_stage()
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1188, in _run_stage
return self._run_evaluate()
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1228, in _run_evaluate
eval_loop_results = self._evaluation_loop.run()
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
self.advance(*args, **kwargs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 152, in advance
dl_outputs = self.epoch_loop.run(self._data_fetcher, dl_max_batches, kwargs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
self.advance(*args, **kwargs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 137, in advance
output = self._evaluation_step(**kwargs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 234, in _evaluation_step
output = self.trainer._call_strategy_hook(hook_name, *kwargs.values())
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/trainer/trainer.py", line 1494, in _call_strategy_hook
output = fn(*args, **kwargs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/pytorch_lightning/strategies/strategy.py", line 399, in test_step
return self.model.test_step(*args, **kwargs)
File "/home/vizua/vid2avatar/code/v2a_model.py", line 269, in test_step
model_outputs = self.model(batch_inputs)
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/vizua/vid2avatar/code/lib/model/v2a.py", line 159, in forward
cond, smpl_tfs, feature_vectors=feature_vectors, is_training=self.training)
File "/home/vizua/vid2avatar/code/lib/model/v2a.py", line 237, in get_rbg_value
_, gradients, feature_vectors = self.forward_gradient(x, pnts_c, cond, tfs, create_graph=is_training, retain_graph=is_training)
File "/home/vizua/vid2avatar/code/lib/model/v2a.py", line 264, in forward_gradient
only_inputs=True)[0]
File "/home/vizua/anaconda3/envs/v2a/lib/python3.7/site-packages/torch/autograd/__init__.py", line 236, in grad
inputs, allow_unused, accumulate_grad=False)
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
Is it because my training is not over? If not, do you know what could be wrong please?
Also I expect test.py to produce a 3D animated avatar but could you tell me what's the concrete output format?
The text was updated successfully, but these errors were encountered:
khelkun
changed the title
Requesting more Getting Started details
ensors does not require grad and does not have a grad_fn
May 22, 2023
khelkun
changed the title
ensors does not require grad and does not have a grad_fn
tensors does not require grad and does not have a grad_fn
May 22, 2023
Thanks for your work @MoyGcc and sorry to bother you because my pytorch and deep learning knowledge is quite basic.
After running into some issues details in #13, I'm now able to run
train.py
. It's now around epoch 700 and I wonder if I'm supposed to let it run until the max epochs defined intrain.py
e.g 8000 ?However I tried to run
test.py
with this trained model at epoch 700. But it complains aboutelement 0 of tensors does not require grad and does not have a grad_fn
with the following output:Is it because my training is not over? If not, do you know what could be wrong please?
Also I expect
test.py
to produce a 3D animated avatar but could you tell me what's the concrete output format?The text was updated successfully, but these errors were encountered: