Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/autograd/__init__.py:173: UserWarning: Error detected in MmBackward0. Traceback of forward call that caused the error:
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/runpy.py", line 196, in _run_module_as_main
- return _run_code(code, main_globals, None,
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/runpy.py", line 86, in _run_code
- exec(code, run_globals)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel_launcher.py", line 17, in <module>
- app.launch_new_instance()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/traitlets/config/application.py", line 978, in launch_instance
- app.start()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/kernelapp.py", line 712, in start
- self.io_loop.start()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/tornado/platform/asyncio.py", line 215, in start
- self.asyncio_loop.run_forever()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/asyncio/base_events.py", line 603, in run_forever
- self._run_once()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/asyncio/base_events.py", line 1899, in _run_once
- handle._run()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/asyncio/events.py", line 80, in _run
- self._context.run(self._callback, *self._args)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 510, in dispatch_queue
- await self.process_one()
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 499, in process_one
- await dispatch(*args)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 406, in dispatch_shell
- await result
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/kernelbase.py", line 730, in execute_request
- reply_content = await reply_content
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/ipkernel.py", line 383, in do_execute
- res = shell.run_cell(
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/ipykernel/zmqshell.py", line 528, in run_cell
- return super().run_cell(*args, **kwargs)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 2885, in run_cell
- result = self._run_cell(
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 2940, in _run_cell
- return runner(coro)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/IPython/core/async_helpers.py", line 129, in _pseudo_sync_runner
- coro.send(None)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3139, in run_cell_async
- has_raised = await self.run_ast_nodes(code_ast.body, cell_name,
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3318, in run_ast_nodes
- if await self.run_code(code, result, async_=asy):
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3378, in run_code
- exec(code_obj, self.user_global_ns, self.user_ns)
- File "/tmp/ipykernel_6795/261130722.py", line 6, in <module>
- state_new = simulate(state_old, model)
- File "/tmp/ipykernel_6795/3537832075.py", line 3, in simulate
- state_new = model(state_old)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
- return forward_call(*input, **kwargs)
- File "/tmp/ipykernel_6795/4011584273.py", line 24, in forward
- out = self.linear_stack(x)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
- return forward_call(*input, **kwargs)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/nn/modules/container.py", line 141, in forward
- input = module(input)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
- return forward_call(*input, **kwargs)
- File "/home/marco/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/nn/modules/linear.py", line 103, in forward
- return F.linear(input, self.weight, self.bias)
- (Triggered internally at ../torch/csrc/autograd/python_anomaly_mode.cpp:104.)
- Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
- ---------------------------------------------------------------------------
- RuntimeError Traceback (most recent call last)
- Cell In [6], line 11
- 9 optimizer.zero_grad()
- 10 loss = lossNN(state_old, state_new, model)
- ---> 11 loss.backward(retain_graph=True)
- 12 optimizer.step()
- 14 state_old = state_new
- File ~/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/_tensor.py:363, in Tensor.backward(self, gradient, retain_graph, create_graph, inputs)
- 354 if has_torch_function_unary(self):
- 355 return handle_torch_function(
- 356 Tensor.backward,
- 357 (self,),
- (...)
- 361 create_graph=create_graph,
- 362 inputs=inputs)
- --> 363 torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
- File ~/mambaforge/envs/PDE_torch/lib/python3.10/site-packages/torch/autograd/__init__.py:173, in backward(tensors, grad_tensors, retain_graph, create_graph, grad_variables, inputs)
- 168 retain_graph = create_graph
- 170 # The reason we repeat same the comment below is that
- 171 # some Python versions print out the first line of a multi-line function
- 172 # calls in the traceback and some print out the last line
- --> 173 Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
- 174 tensors, grad_tensors_, retain_graph, create_graph, inputs,
- 175 allow_unreachable=True, accumulate_grad=True)
- RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [32, 4]], which is output 0 of AsStridedBackward0, is at version 2; expected version 1 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement