Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
technical:recipes:keras-in-virtualenv [2020-02-04 12:22] – created frey | technical:recipes:keras-in-virtualenv [2021-08-06 13:00] (current) – 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 | + | (root) [(my_workgroup:user)@login01 |
</ | </ | ||
Line 47: | Line 47: | ||
</ | </ | ||
- | Answer " | + | Answer " |
+ | <code bash> | ||
+ | (root) [(my_workgroup: | ||
+ | [(my_workgroup: | ||
+ | </ | ||
+ | |||
+ | Notice the '' | ||
===== VALET Package Definition ===== | ===== VALET Package Definition ===== | ||
Line 57: | Line 63: | ||
prefix: / | prefix: / | ||
description: | description: | ||
+ | flags: | ||
+ | - no-standard-paths | ||
actions: | actions: | ||
- action: source | - action: source | ||
script: | script: | ||
- | sh: anaconda-activate.sh | + | sh: intel-python.sh |
order: failure-first | order: failure-first | ||
success: 0 | success: 0 | ||
Line 70: | Line 78: | ||
</ | </ | ||
- | would be added to '' | + | would be added to '' |
<file keras.vpkg_yaml> | <file keras.vpkg_yaml> | ||
Line 76: | Line 84: | ||
prefix: / | prefix: / | ||
description: | description: | ||
+ | flags: | ||
+ | - no-standard-paths | ||
actions: | actions: | ||
- action: source | - action: source | ||
script: | script: | ||
- | sh: anaconda-activate.sh | + | sh: intel-python.sh |
order: failure-first | order: failure-first | ||
success: 0 | success: 0 | ||
Line 97: | Line 107: | ||
</ | </ | ||
- | <note tip>On Caviness, VALET consults | + | <note tip>On Caviness |
+ | |||
+ | ===== 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 | ||
+ | |||
+ | <code bash> | ||
+ | (/work/ | ||
+ | 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 toward its end: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # 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 | ||
+ | </code> |