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

TypeError: relu(): argument 'input' (position 1) must be Tensor, not float #20

Open
xiaoyu20010808 opened this issue Jul 19, 2024 · 0 comments

Comments

@xiaoyu20010808
Copy link

Hi, thanks for the great work,I had some problems replicating the paper, when i run eval_dtu.sh, main.py has an error . on line 183, trainer.validate(volrecon, dataloader_test1).
[rank0]: Traceback (most recent call last):
[rank0]: File "/data/tx/volrecon/VolRecon-main/main.py", line 183, in
[rank0]: trainer.validate(volrecon, dataloader_test1)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 697, in validate
[rank0]: return call._call_and_handle_interrupt(
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/call.py", line 36, in _call_and_handle_interrupt
[rank0]: return trainer.strategy.launcher.launch(trainer_fn, *args, trainer=trainer, **kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/strategies/launchers/subprocess_script.py", line 88, in launch
[rank0]: return function(*args, **kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 745, in _validate_impl
[rank0]: results = self._run(model, ckpt_path=self.ckpt_path)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1112, in _run
[rank0]: results = self._run_stage()
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1188, in _run_stage
[rank0]: return self._run_evaluate()
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1228, in _run_evaluate
[rank0]: eval_loop_results = self._evaluation_loop.run()
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
[rank0]: self.advance(*args, **kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/loops/dataloader/evaluation_loop.py", line 152, in advance
[rank0]: dl_outputs = self.epoch_loop.run(self._data_fetcher, dl_max_batches, kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/loops/loop.py", line 199, in run
[rank0]: self.advance(*args, **kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 137, in advance
[rank0]: output = self._evaluation_step(**kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/loops/epoch/evaluation_epoch_loop.py", line 234, in _evaluation_step
[rank0]: output = self.trainer._call_strategy_hook(hook_name, *kwargs.values())
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/trainer/trainer.py", line 1494, in _call_strategy_hook
[rank0]: output = fn(*args, **kwargs)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/pytorch_lightning/strategies/ddp.py", line 363, in validation_step
[rank0]: return self.model.validation_step(*args, **kwargs)
[rank0]: File "/data/tx/volrecon/VolRecon-main/code/model.py", line 265, in validation_step
[rank0]: self.extract_geometry(batch, batch_idx)
[rank0]: File "/data/tx/volrecon/VolRecon-main/code/model.py", line 375, in extract_geometry
[rank0]: srdf, points_x, depth, rgb = self.infer(batch=batch, ray_idx=ray_idx, source_imgs_feat=source_imgs_feat,
[rank0]: File "/data/tx/volrecon/VolRecon-main/code/model.py", line 143, in infer
[rank0]: rgb, depth, srdf, opacity, weight, points_in_pixel, _ = self.sample2rgb(batch, points_x, z_val, ray_d, ray_idx,
[rank0]: File "/data/tx/volrecon/VolRecon-main/code/model.py", line 85, in sample2rgb
[rank0]: rgb, depth, opacity, weight, variance = self.renderer.render(rearrange(z_val, "B RN SN -> (B RN) SN"),
[rank0]: File "/data/tx/volrecon/VolRecon-main/code/utils/renderer.py", line 32, in render
[rank0]: iter_cos = -(F.relu(-true_cos * 0.5 + 0.5) * (1.0 - cos_anneal_ratio) + F.relu(-true_cos) * cos_anneal_ratio)
[rank0]: File "/data/tx/Anaconda3/envs/UFORecon/lib/python3.10/site-packages/torch/nn/functional.py", line 1500, in relu
[rank0]: result = torch.relu(input)
[rank0]: TypeError: relu(): argument 'input' (position 1) must be Tensor, not float
I can't solve the problem right now, and I'd appreciate your help

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

1 participant