-
Notifications
You must be signed in to change notification settings - Fork 634
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 reporting that leaky ReLU is not yet implemented for PyTorch conversion #736
Comments
Hi @jbmaxwell thanks for reporting the issue! It should be added in the upcoming beta releases of coremltools. As for the timeline, generally coremltools is aligned with the Core ML framework which is aligned with the rest of the Apple OS software. |
Okay, fingers crossed that we'll see it in the next beta—and that it will drop relatively soon! :) I have the model running using LibTorch for now, but I'm curious about performance and have a feeling that the CoreML version will be better optimized for the hardware (correct me if I'm wrong). |
@jbmaxwell To clarify, this implementation is a good reference right? (https://github.com/zhampel/clusterGAN) |
Yes, that's the one. |
Hitting the same issue |
Here a small test case for your convenience. @aseemw @srikris |
Running in the same issue when converting YOLO Object Detection models to CoreML. I am using ReLU as a work-around for now, could we also supply custom activation functions instead of LeakyReLU? Thanks |
@dlawrences Were you able to switch ReLU out for LeakyReLU after training, or did you need to re-train the model from scratch after you did that? If so, how did you change this? |
I have changed the model architecture to use nn.ReLU (https://pytorch.org/docs/master/generated/torch.nn.ReLU.html) instead of nn.LeakyReLU (https://pytorch.org/docs/master/generated/torch.nn.LeakyReLU.html). I don't think the weights trained for the LeakyReLU activation function would have worked that well on plain ReLU tbh - I would expect some gradients would go to zero really fast for the latter one. |
This PR #758 adds |
Pulled coremltools, rebuilt coremltools from TOT, reran the testcase I provided above, and that passes now. Seems like LeakyRelu works. Thanks. |
I was trying to convert a ClusterGAN from PyTorch to CoreML yesterday and got an error about leaky_relu not being implemented yet. Is there a projected timeline for this? It seems to me leaky ReLU is a very popular activation function.
As a workaround, is there a reasonably simple way to write my own for the converter to use?
Any thoughts appreciated.
The text was updated successfully, but these errors were encountered: