Skip to content
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

Change install to one env file & update docs #484

Merged
merged 11 commits into from Mar 24, 2021
Merged

Conversation

mathieuboudreau
Copy link
Member

@mathieuboudreau mathieuboudreau commented Mar 22, 2021

Checklist

  • I've given this PR a concise, self-descriptive, and meaningful title
  • I've linked relevant issues in the PR body
  • I've applied the relevant labels to this PR
  • I've added relevant tests for my contribution
  • I've updated the documentation and/or added correct docstrings
  • I've assigned a reviewer
  • I've consulted ADS's internal developer documentation to ensure my contribution is in line with any relevant design decisions

Resolves #481, Resolves #482, Resolves #483

@mathieuboudreau mathieuboudreau added documentation category: the change is documentation related to AxonDeepSeg installation category: the change alters the installation of AxonDeepSeg labels Mar 22, 2021
@mathieuboudreau
Copy link
Member Author

@jcohenadad I had to leave activating the conda env in the installation step, as the installation step needs another command within in (pip install -e .). However, I've added a small section under the "Using AxonDeepSeg" section to say that you need to activate the venv if not already activated.

@mariehbourget
Copy link
Member

We made the changes to use only the common environment.yml file to install ADS on all OS.
I tested it on my laptop in Ubuntu 20.04 in WSL1 and Windows 10, everything is working as expected.

@vs74, @Stoyan-I-A, @dyt811, @ahill187, @joshuacwnewton, @gisellemartel Could you re-test the installation using this branch? The rendered doc is here. Thank you everyone for your help!

@vasudev-sharma
Copy link
Contributor

vasudev-sharma commented Mar 22, 2021

Installed ADS by referring to the docs of this PR. I had no issues with the installation on MacOS Mojave. Tested axondeepseg_test and fsleyes too; everything works like a charm.

@joshuacwnewton
Copy link
Member

Installing worked for me on Ubuntu 20.04, as well. 🙂

@Stoyan-I-A
Copy link
Member

The installation worked. Tested on Windows 10.

@gisellemartel
Copy link

gisellemartel commented Mar 23, 2021

Installation worked for me on MacOS Catalina 10.15.7! Testing the installation however failed for axondeepseg_test. Here is a log: log.txt

@Stoyan-I-A
Copy link
Member

Installation worked for me on MacOS Catalina 10.15.7! Testing the installation however failed for axondeepseg_test. Here is a log: log.txt

Have you used the Theano backend in the past? It looks like the software is trying to use Theano instead of tensorflow.

@mathieuboudreau
Copy link
Member Author

mathieuboudreau commented Mar 23, 2021

Installation worked for me on MacOS Catalina 10.15.7! Testing the installation however failed for axondeepseg_test. Here is a log: log.txt

Have you used the Theano backend in the past? It looks like the software is trying to use Theano instead of tensorflow.

Hmm interesting, could this be a tool that was installed with pip and the --user install flag? I've encountered instances where those have leaked into my venvs, very annoying and tough to troubleshoot if you're not aware/remember.

@mariehbourget
Copy link
Member

I found this, it seems to be an issue when installing Keras through conda-forge, though the post is 3 years old.

The only way I found to switch the backend permanently was to explicitly export the variable in ${CONDA_PREFIX}/etc/conda/activate.d/keras_activate.sh with export KERAS_BACKEND="tensorflow"

@mathieuboudreau
Copy link
Member Author

I found this, it seems to be an issue when installing Keras through conda-forge, though the post is 3 years old.

The only way I found to switch the backend permanently was to explicitly export the variable in ${CONDA_PREFIX}/etc/conda/activate.d/keras_activate.sh with export KERAS_BACKEND="tensorflow"

@gisellemartel could you try this fix temporarily to see if resolves the issue? If so, @mariehbourget let's just make a quick Notice for it on the ReadTheDocs, as it seems like a rare issue and we're migrating away from Keras when we move to IVADOMED soon.

@mariehbourget
Copy link
Member

@gisellemartel, did you get the chance to test the fix describe above?

@gisellemartel
Copy link

@gisellemartel, did you get the chance to test the fix describe above?

Thank you @mariehbourget @mathieuboudreau @Stoyan-I-A for your suggestions. I tried the suggested fix and it worked! I do still get some warnings after running the test however
log.txt

@mariehbourget
Copy link
Member

Thanks @gisellemartel for the tests.

@mathieuboudreau, I added the warning to the doc. Can you review it and let me know if that is ok with you (I can't assign you officially since you opened the PR). Thanks!

Comment on lines +118 to +119
.. NOTE :: For some users, the test may fail because Keras is using Theano backend instead of Tensorflow. In that case, you will see the line ``Using Theano backend.`` when launching ``axondeepseg_test``. To fix this issue, add the line ``export KERAS_BACKEND="tensorflow"`` at the end of the ``<your_conda_install_location>\envs\<your_environment_name>/etc/conda/activate.d/keras_activate.sh`` file, then deactivate and reactivate your environment. The test should print ``Using Tensorflow backend.`` and pass.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to warn about this?

IIRC, the Keras project has moved on from non-Tensorflow backends ever since it was integrated into TF. They used to have this warning:

Multi-backend Keras has been discontinued. At this time, we recommend that Keras users who use multi-backend Keras with the TensorFlow backend switch to tf.keras in TensorFlow 2.0.

So, I would hope that typically Keras users wouldn't run into this issue.

(Though, now that I'm looking into this, they recently edited their README to remove information about this. Now it's "under construction". Hrm.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to warn about this because in particular, one of our test users encountered exactly this issue here in this thread =)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess what I'm asking is, could this be an isolated incident that doesn't apply to most users? 😛

@mathieuboudreau
Copy link
Member Author

@mariehbourget The message reads well for me; if the tests pass you can approve and merge, which will open the door to merging #479.

@mathieuboudreau
Copy link
Member Author

mathieuboudreau commented Mar 24, 2021 via email

@mariehbourget mariehbourget merged commit ffa7680 into master Mar 24, 2021
@mathieuboudreau mathieuboudreau deleted the mb/48-environment branch March 11, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation category: the change is documentation related to AxonDeepSeg installation category: the change alters the installation of AxonDeepSeg
Projects
None yet
6 participants