-
Notifications
You must be signed in to change notification settings - Fork 77
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
Error when JIT save #75
Comments
There is an issue from another model that says saving and loading without jit helped, but it didn't work for me. |
Got the same error when using
|
Any solutions? |
Hi, I do believe that extension using the CUDAExtension class API is deprecated and not compatible with the Jit saver. If you want to use this CUDA code in your jit compiled model, you might want to use more modern alternatives like https://pytorch.org/tutorials/advanced/torch_script_custom_ops.html |
When trying to save as JIT, it doesn't work.
Sample minimum code:
The error is:
Any help or suggestions are appreciated!
Full error message:
1 frames
/usr/local/lib/python3.7/dist-packages/torch/jit/_script.py in save(self, f, **kwargs)
594 See :func:
torch.jit.save <torch.jit.save>
for details.595 """
--> 596 return self._c.save(str(f), **kwargs)
597
598 def _save_for_lite_interpreter(self, *args, **kwargs):
RuntimeError:
Could not export Python function call 'SpatialCorrelationSamplerFunction'. Remove calls to Python functions before export. Did you forget to add @script or @script_method annotation? If this is a nn.ModuleList, add it to constants:
/usr/local/lib/python3.7/dist-packages/spatial_correlation_sampler/spatial_correlation_sampler.py(42): spatial_correlation_sample
(18): forward
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py(1039): _slow_forward
/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py(1051): _call_impl
/usr/local/lib/python3.7/dist-packages/torch/jit/_trace.py(959): trace_module
/usr/local/lib/python3.7/dist-packages/torch/jit/_trace.py(744): trace
(2):
/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py(2882): run_code
/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py(2822): run_ast_nodes
/usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py(2718): run_cell
/usr/local/lib/python3.7/dist-packages/ipykernel/zmqshell.py(537): run_cell
/usr/local/lib/python3.7/dist-packages/ipykernel/ipkernel.py(208): do_execute
/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py(399): execute_request
/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py(233): dispatch_shell
/usr/local/lib/python3.7/dist-packages/ipykernel/kernelbase.py(283): dispatcher
/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py(300): null_wrapper
/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py(434): _run_callback
/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py(480): _handle_recv
/usr/local/lib/python3.7/dist-packages/zmq/eventloop/zmqstream.py(451): _handle_events
/usr/local/lib/python3.7/dist-packages/tornado/stack_context.py(300): null_wrapper
/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py(122): _handle_events
/usr/lib/python3.7/asyncio/events.py(88): _run
/usr/lib/python3.7/asyncio/base_events.py(1786): _run_once
/usr/lib/python3.7/asyncio/base_events.py(541): run_forever
/usr/local/lib/python3.7/dist-packages/tornado/platform/asyncio.py(132): start
/usr/local/lib/python3.7/dist-packages/ipykernel/kernelapp.py(499): start
/usr/local/lib/python3.7/dist-packages/traitlets/config/application.py(845): launch_instance
/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py(16):
/usr/lib/python3.7/runpy.py(85): _run_code
/usr/lib/python3.7/runpy.py(193): _run_module_as_main
The text was updated successfully, but these errors were encountered: