Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb8ac1b

Browse filesBrowse files
committed
Add Pytorch 1.0.1 for python3.6
1 parent 50f4a48 commit eb8ac1b
Copy full SHA for eb8ac1b

File tree

Expand file treeCollapse file tree

4 files changed

+98
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+98
-0
lines changed
Open diff view settings
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+25Lines changed: 25 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,28 @@ AWS Lambda pack in Python for processing satellite imagery. Basically it enables
300300
- Pyproj (https://github.com/jswhit/pyproj)
301301
- Shapely (https://github.com/Toblerity/Shapely)
302302
- PIL (https://pillow.readthedocs.io/)
303+
304+
---
305+
306+
### PyTorch
307+
308+
Python 3.6 based PyTorch
309+
310+
#### Tools
311+
312+
- PyTorch 1.0.1 (CPU)
313+
- torchvision 0.2.1
314+
315+
#### Installed Packages (deps)
316+
317+
- numpy-1.16.1
318+
- pillow-5.4.1
319+
- six-1.12.0
320+
- torchvision-0.2.1
321+
322+
#### Build Pack
323+
324+
```bash
325+
# You need `docker` before run
326+
./build-with-docker.sh
327+
```
Collapse file

‎pytorch/build-with-docker.sh‎

Copy file name to clipboard
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
docker pull amazonlinux:1
2+
docker run -v $(pwd):/outputs --name lambdapackgen-pytorch -d amazonlinux:1 tail -f /dev/null
3+
docker exec -i -t lambdapackgen-pytorch /bin/bash /outputs/buildPack_py3.sh
4+
Collapse file

‎pytorch/buildPack_py3.sh‎

Copy file name to clipboard
+69Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
dev_install () {
2+
yum -y update
3+
yum -y upgrade
4+
yum install -y \
5+
wget \
6+
gcc \
7+
gcc-c++ \
8+
python36-devel \
9+
python36-virtualenv \
10+
python36-pip \
11+
findutils \
12+
zlib-devel \
13+
zip
14+
}
15+
16+
pip_rasterio () {
17+
cd /home/
18+
rm -rf env
19+
python3 -m virtualenv env --python=python3
20+
source env/bin/activate
21+
pip3 install https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl
22+
pip3 install torchvision
23+
deactivate
24+
}
25+
26+
27+
gather_pack () {
28+
# packing
29+
cd /home/
30+
source env/bin/activate
31+
32+
rm -rf lambdapack
33+
mkdir lambdapack
34+
cd lambdapack
35+
36+
cp -R /home/env/lib/python3.6/site-packages/* .
37+
cp -R /home/env/lib64/python3.6/site-packages/* .
38+
echo "original size $(du -sh /home/lambdapack | cut -f1)"
39+
40+
# cleaning libs
41+
rm -rf external
42+
find . -type d -name "tests" -exec rm -rf {} +
43+
44+
# cleaning
45+
find -name "*.so" | xargs strip
46+
find -name "*.so.*" | xargs strip
47+
# find . -name tests -type d -print0|xargs -0 rm -r --
48+
# find . -name test -type d -print0|xargs -0 rm -r --
49+
rm -r pip
50+
rm -r pip-*
51+
rm -r wheel
52+
rm -r wheel-*
53+
rm easy_install.py
54+
find . -name \*.pyc -delete
55+
# find . -name \*.txt -delete
56+
echo "stripped size $(du -sh /home/lambdapack | cut -f1)"
57+
58+
# compressing
59+
zip -FS -r9 /outputs/pack.zip * > /dev/null
60+
echo "compressed size $(du -sh /outputs/pack.zip | cut -f1)"
61+
}
62+
63+
main () {
64+
dev_install
65+
pip_rasterio
66+
gather_pack
67+
}
68+
69+
main
Collapse file

‎pytorch/pack.zip‎

Copy file name to clipboard
72.7 MB
Binary file not shown.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.