-
Notifications
You must be signed in to change notification settings - Fork 8
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
knnmodule.hpp: Type Error raised when id is a string #69
Comments
Thanks for pointing this out. In python2, the id was of type string which no longer exists in python3 and can be replaced with either Unicode or Bytes. Apparently during porting Gamera to python3, the decision was made to use Bytes for the id. I have just noted that this causes other problems, too, e.g. when calling Where did you add your workaround of converting the id to a Bytes object? In your copy of teh gamera code? In your application code? If you can provide a simple test script and simple test data that causes the problem, this would be helpful. |
We did the fix on our own fork, gamera4-rodan on the branch |
Did you mange to create a small test case that reproduces the error? I think it would be best to change the id to be Unicode instead of Bytes, but I would need a test case that reproduces the bug and check whether it actually goes away when the changes are made. |
I have trouble building and testing gamera on my local environment so creating a test script is a bit difficult at the moment. We did experience some issue with another job that uses the same function |
Are there any details on your issues? Maybe there is some guidance available on this. |
I'm unsure if this is an issue and would like to get clarifications.
We are using gamera-4 to classify 2 xml inputs using the Interactive Classifier. This error was raised when
classify_with_images
was called. Inknncoremodule.cpp
the functionknn_classify_with_images
is callingimage_get_id_name
where it throws the error "knn: could not get string from id_name tuple." on line 90. More specifically, this one:Further investigation suggested that the error is being thrown when
id
(which is theclass_name
as I understand) is not of typebytes
and we worked around this error by converting it from PyUnicode to a PyBytes object.My main question is was
id
intended to be a PyBytes object? I looked throughcore.py
and underclassify_manual
andclassify_automatic
(line 341 and 367), id_name was checked to see whether it is a string or unicode object with the util function (line 359).If i misunderstood the how this works I would really appreciate it if you can correct me. Thank you very much!
The text was updated successfully, but these errors were encountered: