-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Quick Fix for Python 3.7 #21202
Quick Fix for Python 3.7 #21202
Conversation
@alextp @asimshankar Should we merge this PR instead of #20766 since there has been no updates on the other PR? |
Whichever PR makes progress is fine with me :) That said, the comments on that PR still apply here:
@bstriner : Would you be able to update this PR to do 2.? |
…char*" instead of a "char*". (See https://docs.python.org/3/whatsnew/3.7.html#c-api-changes) There are additional changes needed for Python 3.7 compatibility, this change just pulls out one of them (and subsumes a related attempt in #21202 and #20766) Helps with #20517 PiperOrigin-RevId: 207008013
@asimshankar I'm trying to change SWIG interface to fix the problem as you suggested. However I got the following error:
It seems that |
protobuf 3.6.1 has fixed the problem already. |
@ppwwyyxx : I might be reading incorrectly, but it seems that protobuf 3.6.1 does not include the change to make it compatible with Python 3.7 (commit protocolbuffers/protobuf@0a59054 isn't included in the 3.6.x branch) @Hong-Xiang : You're right, we'll need to update the version of protobuf that TensorFlow depends on, perhaps after there is a release version of protobuf that is compatible with Python 3.7? |
I think this would also fix #20444. |
I'll take a look tonight. One issue was getting swig to generate consts for
temporary variables. Afk right now but will post details later.
…On Mon, Aug 13, 2018, 4:45 PM Martin Wicke ***@***.***> wrote:
I think this would also fix #20444
<#20444>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#21202 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL4rbDTfnMCKxHf0pdzhrTTkR1zGvWhPks5uQeV9gaJpZM4Vk9NK>
.
|
@asimshankar the renames seem cleaner if we do them in the cpps, but I'm willing to go either way. Bulky to have custom wrappers for a few functions just because of the
Any way we do it, any thoughts on the rename? Thanks! |
@asimshankar BTW, do the The void pointer gets casted up to |
Thanks @bstriner : It seems that at this point this PR can be reduced to 2 lines, let's just do that: Change Regarding |
This includes the protobuf bump as well just so I could get it to build, but let me know what you want to do about that. Moved the protobuf data into defines so it is just one place instead of 3 places. I don't have a good way to get rid of the SWIG is currently generating char *arg2 = (char *) 0 ;
arg2 = const_cast<char*>(TFE_GetPythonString(obj1));
TFE_ContextAddFunctionDef(arg1,(char const *)arg2,arg3,arg4); I want it to generate this but I can't figure out how to make const char *arg2 = (const char *) 0 ;
arg2 = TFE_GetPythonString(obj1);
TFE_ContextAddFunctionDef(arg1,arg2,arg3,arg4); Does anyone know a way to get that |
@asimshankar the thing responsible for like 50% of the |
Just built python3.7 successfully on both linux and windows. New protobuf has issues on windows so I had to make a patch file. Add these 2 patch files to build on windows: |
@bstriner nice work. hope the pr merged soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Thanks! Is there a separate issue already for tracking protobuf and eigen fixes? Also might want to start an issue in swig for that const issue. |
PiperOrigin-RevId: 210447509
Come on guys please upgrade to python 3.7 and make official release..... I need typing and data classes from python 3.7 |
@SpikingNeurons I feel you, but can you post any issues you have building from source with the above? |
@bstriner Unfortunately, I depend on windows binaries and don't compile from source. Its shame that I cannot add value. |
I'm getting this error as soon as I change the protobuf URLs/checksum/prefix for the ones above:
Works fine when I change it for 3.6.1, but the fix for Python 3.7 is not included. Any idea what I'm doing wrong? |
@mattpepin copy bazel_skylib from protobuf workspace to tensorflow workspace. Let me know if you have any issues after that. |
@bstriner Thanks! It worked perfectly! |
@bstriner I don't understand if this issue has been resolved for Ubuntu with a PR+merge or not. I tried a git checkout r1.10, a bazel clean, reconfigure and build, but still get the Protobuf error. Am I supposed to do something manual for this to build on Python 3.7, Ubuntu 18.04? r1.12 also does not compile. |
I just tried to build the r1.12 branch:
I'm using Arch linux with up-to-date packages, i.e. Python 3.7 and so on. |
@RyanRosario correct. There is no stable release of protobuf with the required changes. See discussion above and in the linked post about how to switch protobuf versions. Feel free to check github for current master and try that version. @Hoeze That is also a protobuf issue. Same story. |
what does this mean? |
Fix for 3.7 I made before I found #20766
Just built CUDA 9.2 CuDNN 7 compute 6.1 python 3.7 on VS2017 using CMake.
That seems to be the place for working on what will be the final version, but I'm just putting this out there if anyone wants a quick fix in the meantime (currently that PR conflicts). This version casts away consts, so it isn't exactly safe but should be fine if you just want things up and running. Tensorflow overuses const_cast but that is an issue for another day.
Just merging this branch into your own work is an easy option if you need to build for 3.7. I'll close this PR when the other branch gets finished.
Related reading materials:
Cheers