-
Notifications
You must be signed in to change notification settings - Fork 106
Non-tensor models #249
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Here's the error using non-tensor output, and the segfault I get when I run the model in gears. 21273:M 21 Nov 2019 15:20:25.319 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. 21273:M 21 Nov 2019 15:20:37.457 * ONNX backend loaded from /root/dev/redis-5.0.5/RedisAI/install-cpu/backends/redisai_onnxruntime/redisai_onnxruntime.so === REDIS BUG REPORT START: Cut & paste starting from here === ------ STACK TRACE ------ Backtrace: ------ INFO OUTPUT ------ Serverredis_version:5.0.5 Clientsconnected_clients:1 Memoryused_memory:45603648 Persistenceloading:0 Statstotal_connections_received:3 Replicationrole:master CPUused_cpu_sys:0.279832 Commandstatscmdstat_rg.pyexecute:calls=1,usec=324010,usec_per_call=324010.00 Clustercluster_enabled:0 Keyspacedb0:keys=4,expires=0,avg_ttl=0 ------ CLIENT LIST OUTPUT ------ ------ REGISTERS ------ ------ FAST MEMORY TEST ------ |
Hi @irthomasthomas, "UserWarning: Tensor APIs are depricated and will be removed from the future release." (apart from the spelling issues that I just noted /cc @hhsecond ) only indicates that you are using a deprecated API for the RedisAI Python client. Things have gotten simpler since then, you can just set NumPy arrays directly to
becomes
The other warning is telling you that for the time being we do not support outputs from ONNX and ONNX-ML models that are not tensors. So if the model outputs a raw scalar, for instance, or a string, that output will not be returned. However, this is not a blocking error, and the remaining tensor outputs are returned to the client. @gkorland @MeirShpilraien maybe more of a Gears issue, i.e. the way this situation is handled at the API level? |
Thank you for the info. I just tried your suggestion and it still produces
the same tesnor API UserWarning.
…On Fri, 22 Nov 2019 at 09:18, Luca Antiga ***@***.***> wrote:
Hi @irthomasthomas <https://github.com/irthomasthomas>,
FYI the two warnings are unrelated. The first
"UserWarning: Tensor APIs are depricated and will be removed from the
future release."
(apart from the spelling issues that I just noted /cc @hhsecond
<https://github.com/hhsecond> ) only indicates that you are using a
deprecated API for the RedisAI Python client. Things have gotten simpler
since then, you can just set NumPy arrays directly to TENSORSET. In your
code
tensor = redisai.BlobTensor.from_numpy(sample.astype(np.float32))
rai.tensorset('tensor', tensor)
becomes
rai.tensorset('tensor', sample.astype(np.float32))
The other warning is telling you that for the time being we do not support
outputs from ONNX and ONNX-ML models that are not tensors. So if the model
outputs a raw scalar, for instance, or a string, that output will not be
returned. However, this is not a blocking error, and the remaining tensor
outputs are returned to the client.
@gkorland <https://github.com/gkorland> @MeirShpilraien
<https://github.com/MeirShpilraien> maybe more of a Gears issue, i.e. the
way this situation is handled at the API level?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#249>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE476NDJOEETUL2A56MXAXTQU6PXNANCNFSM4JQEJRIA>
.
|
@irthomasthomas That's an internal warning that says internally it's still using the tensor APIs. I would say don't bother about it for now and I understand how confusing that could be. So I am pushing another version of redisai-py soon with with APIs for the latest changes that came into RedisAI and will have a fix for this warning as well. I have also created another issue in redisai-py repo to track this. Thanks, |
@hhsecond It no longer crashes but produces "ERROR: type 0 is not supported in this function" and returns NONE. Am I doing something wrong in the gears version? Cheers |
Dear all, I am using the latest version of the docker image redislabs/redismod:edge in order to learn more about RedisGears and RedisAI. It seems that I am facing the same issue as @irthomasthomas as I get the error when running a random forest classifier converted from scikit-learn to ONNX: ERR: non-tensor output from ONNX models, ignoring (currently unsupported). Are there any updates on this issue? Thanks a lot! |
Hi @dsmanl, we haven't looked into this recently as we are currently working at performance-oriented features, but it's something we'll need to solve soon. The concept of a tensor is entrenched in RedisAI, but we could think about converting non-tensor output to Redis data structures (e.g. nested lists), for clients to consume. You also might be interested in taking a look at https://github.com/microsoft/hummingbird, which converts scikit-learn models to PyTorch. It's probably not |
@lantiga thanks a lot! I have heard about `hummingbird, but have not used it yet. |
Hey, FYI, we have just merged the PR and |
@interesaaat thanks, I just updated an example to use the |
Ah this is because you only need the actual torch blob, not the Hummingbird zip, correct? I think you can achieve the same by pulling the actual model out of the Hummingbird container (i.e., |
I tried the |
Yes either that or |
Hi
I uploaded an example of a non-tensor output model. It produces two warnings. "UserWarning: Tensor APIs are depricated and will be removed from the future release." and on the server I get "ERR: non-tensor output from ONNX models, ignoring (currently unsupported)"
When I use the redisai python client it seems to predict ok despite the error. So I then tried to do the same in gears and I managed to get a segfault on model run, but I don't know if that's my fault or a separate gears issue, or the same issue.
Here's the scripts you need to test. https://github.com/irthomasthomas/redisai-non-tensor-model Just change the vectorizer path in the gears file. I commented out the line which segfaults.
Cheers
Thomas
The text was updated successfully, but these errors were encountered: