-
Notifications
You must be signed in to change notification settings - Fork 623
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
PyTorch 1.6.0 released today - breaks coremltools converter v4.0b2 in many cases with AttributeError: module 'torch._C' has no attribute '_jit_pass_canonicalize_ops' #827
Comments
While I do not know how to fix it properly, this is what I can see in case that is helpful for someone else.
There are two alternatives without the _ops: Neither one has lasting success as we then end up with (sometimes, not always)
And that error is working on a constant which has 'value' but not 'ival '. |
The same issue occurred in my case. Steps to reproduce
Getting the AttributeError
|
As we have seen no patch from the coremltools team, may I politely enquire whether coremltools plans to be compatible with PyTorch 1.6 going forward? |
Yes, we are currently working on resolving the issues with pytorch 1.6.0 and the next coremltools beta release will support it. |
Is there any way to avoid this error by downgrading the PyTorch version? |
Maybe I misunderstand the question but PyTorch 1.5.1 works fine with coremltoolsv4.0b2 or TOT latest. I use "pip" to jump between forward and backward between sets of pytorch/torchvision etc of compatible versions. Going forward, we just need to know for sure that 1.6.x will work as well, and @aseemw confirmed earlier it will. It would be nice to know when that fix will drop of course, hint ;) And, please verify torchvision and audio as well with Pytorch 1.6, thanks. |
The 4.0b3 release of coremltools fixes this issue. |
…apple#827) * up * finish * add more tests * up * up * finish
I just noticed that PyTorch 1.6.0 was released. Now, many test cases from the last 2 weeks break with the log below and I believe a similar issue was reported earlier in issue #751 for pytorch nightly
Reproducible::--------------------------
yes, with torch =1.6.0 and torchvision = 0.7.0
Example test cases that fail now are #823 #825 or
#736 (comment)
Log:--------------------------
Traceback (most recent call last):
File "testAssert.py", line 55, in
inputs= [ ct.TensorType(name="input1", shape=dummy_input.shape) ]
File "
/Library/Python/3.7/lib/python/site-packages/coremltools/converters/_converters_entry.py", line 299, in convert/Library/Python/3.7/lib/python/site-packages/coremltools/converters/mil/converter.py", line 120, in _convert**kwargs
File "
prog = frontend_converter(model, **kwargs)
File "
/Library/Python/3.7/lib/python/site-packages/coremltools/converters/mil/converter.py", line 62, in call/Library/Python/3.7/lib/python/site-packages/coremltools/converters/mil/frontend/torch/load.py", line 73, in loadreturn load(*args, **kwargs)
File "
converter = TorchConverter(torchscript, inputs, outputs, cut_at_symbols)
File "
/Library/Python/3.7/lib/python/site-packages/coremltools/converters/mil/frontend/torch/converter.py", line 141, in init/Library/Python/3.7/lib/python/site-packages/coremltools/converters/mil/frontend/torch/converter.py", line 273, in _expand_and_optimize_irraw_graph, params_dict = self._expand_and_optimize_ir(self.torchscript)
File "
_torch._C._jit_pass_canonicalize_ops(graph)
AttributeError: module 'torch._C' has no attribute '_jit_pass_canonicalize_ops'
The text was updated successfully, but these errors were encountered: