-
Notifications
You must be signed in to change notification settings - Fork 32
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
Move to Python 3.6 compatibility #129
Conversation
…lt was changed to byte in Python 3.x)
…o byte prior to handling in pickle
…ry files, so instead write to a normal file in a temp folder. Also improve invalid data format of temp file.
… in behaviour that may have unanticipated consequences (as seen from warnings)
…le to be saved for clarity
… remove file before test that tries to overwrite
…ith predetermined temporary file names
This branch finally passed all tests on a Windows 10 machine. Output of py.test:
Python version details:
Virtual Environment details:
|
Things that are left to do before merging and upgrading ADS to Python 3.6:
Anything else? |
@alexfoias can you do the install test on win10 once ready to merge? |
On another note, I've uploaded a dev version of this version on PyPi, you can access it by running |
@mathieuboudreau here is the result of ---------- coverage: platform darwin, python 3.6.6-final-0 -----------
|
@oumayb Was there anything printed above what you posted here? Usually the information on the test failure is above that (maybe copy and paste from starting from where you did your command?) |
@mathieuboudreau yes sorry, the error is in the following log. I couldn't copy the whole thing because of the characters count limit. ======================================================================================================================================= test session starts ======================================================================================================================================= test/test_config_tools.py ......... [ 13%] ============================================================================================================================================ FAILURES ============================================================================================================================================= self = <tensorflow.python.client.session.Session object at 0x124b0a0f0>, fn = <function BaseSession._do_run.._run_fn at 0x12800b510>
../miniconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py:1322: feed_dict = {<tensorflow.python.pywrap_tensorflow_internal.TF_Output; proxy of <Swig Object of type 'TF_Output *' at 0x124a70240> ...ernal.TF_Output; proxy of <Swig Object of type 'TF_Output *' at 0x124a701e0> >: array([1.0898974], dtype=float32), ...}
../miniconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py:1307: self = <tensorflow.python.client.session.Session object at 0x124b0a0f0>, options = None
E tensorflow.python.framework.errors_impl.InvalidArgumentError: Nan in summary histogram for: upconv-d1/convolution/weights_0_grad ../miniconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py:1409: InvalidArgumentError During handling of the above exception, another exception occurred: self = <test_train_network.TestCore object at 0x127fa4908>
test/test_train_network.py:133: AxonDeepSeg/train_network.py:497: in train_model self = <tensorflow.python.client.session.Session object at 0x124b0a0f0>, fn = <function BaseSession._do_run.._run_fn at 0x12800b510>
E tensorflow.python.framework.errors_impl.InvalidArgumentError: Nan in summary histogram for: upconv-d1/convolution/weights_0_grad ../miniconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py:1335: InvalidArgumentError |
Outputs of
|
I'll update the installation documentation with some Anaconda instructions for how to create virtual environments with a specified version of python. There's also a way to do so with the native |
@alexfoias have you had the chance to do what Julien requested a while back – create a virtual environment running Python 3.6 on a Windows machine and test this branch ( |
@mathieuboudreau sorry I missed that one. I will do it right away & I will keep you posted. |
@alexfoias No worries – thanks! Let me know if you run into any issues. |
@mathieuboudreau why did you recommend to use a virtualenv for python ? Aren't native python 3.6 with pip & git installed enough ? |
here is the output of the test: ` (ads_python36) C:\Users\neuropoly\ads_test\axondeepseg>py.test --cov AxonDeepSeg/ --cov-report term-missing test\test_config_tools.py ......... [ 13%] ----------- coverage: platform win32, python 3.6.5-final-0 -----------
|
@alexfoias We've always had installation instructions for ADS that include virtual environments. It's "cleaner" to use different virtual environments for different python softwares, as the package version requirements (see here) can (do) differ between them. If you were using python to develop other software, then installed the ADS requirements on the "default" python environment, package versions (e.g. tensorflow, numpy, etc) would all change from what you were using before, causing you a giant headache and likely "breaking" your old code 😅 I personally prefer creating virtual environments with Anaconda's |
@alexfoias Excellent - thanks! |
@mathieuboudreau I ran two identical trainings, one with the 2.7 version and the other with the 3.6 version, and it was a success, the results were very similar! |
…out Py2.7 no longer supported
@oumayb I just did some final minor changes (increased version number, updated release date). Could you quickly approve again? |
This branch isn't ready for merging yet, please standby. I'm simply making this PR to see the merge conflicts. There's still 3 failing tests and 1 errored test in Windows.