Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revisionBoth sides next revision | ||
technical:recipes:keras-in-virtualenv [2020-02-04 12:25] – [Create Keras Virtualenv] frey | technical:recipes:keras-in-virtualenv [2020-02-04 12:37] – frey | ||
---|---|---|---|
Line 30: | Line 30: | ||
[(my_workgroup: | [(my_workgroup: | ||
Adding package `intel-python/ | Adding package `intel-python/ | ||
- | (root) [(it_nss:frey)@login01 ~]$ | + | (root) [(my_workgroup:user)@login01 ~]$ |
</ | </ | ||
Line 38: | Line 38: | ||
<code bash> | <code bash> | ||
- | (root) [(it_nss:frey)@login01 ~]$ conda create --prefix=${WORKDIR}/ | + | (root) [(my_workgroup:user)@login01 ~]$ conda create --prefix=${WORKDIR}/ |
</ | </ | ||
Line 50: | Line 50: | ||
<code bash> | <code bash> | ||
- | (root) [(it_nss:frey)@login01 ~]$ vpkg_rollback | + | (root) [(my_workgroup:user)@login01 ~]$ vpkg_rollback |
- | [(it_nss:frey)@login01 ~]$ | + | [(my_workgroup:user)@login01 ~]$ |
</ | </ | ||
Line 105: | Line 105: | ||
<note tip>On Caviness after a user has used the '' | <note tip>On Caviness after a user has used the '' | ||
+ | ===== Install SKLearn ===== | ||
+ | |||
+ | The SKLearn package is not present in the conda online repositories, | ||
+ | |||
+ | <code bash> | ||
+ | [(my_workgroup: | ||
+ | Adding dependency `intel-python/ | ||
+ | Adding package `keras/ | ||
+ | (/ | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | A prefix has reappeared on the prompt — the path at which the new Keras virtualenv was created — and the '' | ||
+ | |||
+ | <code bash> | ||
+ | (/ | ||
+ | Collecting sklearn | ||
+ | Downloading .. | ||
+ | : | ||
+ | Successfully built sklearn | ||
+ | Installing collected packages: joblib, scikit-learn, | ||
+ | Successfully installed joblib-0.14.1 scikit-learn-0.22.1 sklearn-0.0 | ||
+ | (/ | ||
+ | 0.22.1 | ||
+ | </ | ||
+ | |||
+ | The Keras environment with SKLearn is now ready for use. | ||
+ | |||
+ | ===== Job Scripts ===== | ||
+ | |||
+ | Any job scripts you submit that want to run scripts using this virtualenv should include something like the following: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # Setup Keras virtualenv: | ||
+ | # | ||
+ | vpkg_require keras/ | ||
+ | |||
+ | # | ||
+ | # Run a Python script in that virtualenv: | ||
+ | # | ||
+ | python3 my_keras_work.py | ||
+ | rc=$? | ||
+ | |||
+ | # | ||
+ | # Do cleanup work, etc.... | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # Exit with whatever exit code our Python script handed back: | ||
+ | # | ||
+ | exit $rc | ||
+ | </ | ||