Skip to content

Commit 94ef2fc

Browse files
authored
Merge pull request #22 from TensorPy/updates
Updates
2 parents 5d63671 + 46f224b commit 94ef2fc

13 files changed

Lines changed: 47 additions & 85 deletions

Dockerfile

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,46 @@
11
# TensorPy Docker Image
2-
FROM ubuntu:15.10
2+
FROM ubuntu:17.10
33

4-
#=======================================
5-
# Install Python and Basic Python Tools
6-
#=======================================
7-
RUN apt-get update && apt-get install -y python python-pip python-setuptools \
8-
python-dev python-distribute python-virtualenv
4+
#================================
5+
# Update apt-get package sources
6+
#================================
7+
RUN apt-get update
98

10-
#=========================================
11-
# Install Bash Command Line Tools and Git
12-
#=========================================
9+
#==================================================
10+
# Install Bash Command Line Tools, Python, and Git
11+
#==================================================
1312
RUN apt-get -qy --no-install-recommends install \
13+
python \
14+
python-dev \
15+
python-pip \
16+
python-distribute \
17+
python-virtualenv \
18+
python-setuptools \
1419
sudo \
1520
unzip \
1621
wget \
1722
curl \
23+
libxi6 \
24+
libgconf-2-4 \
1825
vim \
1926
git-core \
2027
&& rm -rf /var/lib/apt/lists/*
2128

22-
#========================================
23-
# Add normal user with passwordless sudo
24-
#========================================
25-
RUN sudo useradd seluser --shell /bin/bash --create-home \
26-
&& sudo usermod -a -G sudo seluser \
27-
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers
28-
29-
#==============================
30-
# Locale and encoding settings
31-
#==============================
32-
ENV LANGUAGE en_US.UTF-8
33-
ENV LANG ${LANGUAGE}
34-
RUN locale-gen ${LANGUAGE} \
35-
&& dpkg-reconfigure --frontend noninteractive locales
36-
3729
#==============================
3830
# Set up TensorFlow / TensorPy
3931
#==============================
40-
COPY third_party/docker/docker_install.sh /TensorPy/docker_install.sh
32+
COPY install.sh /TensorPy/install.sh
4133
COPY requirements.txt /TensorPy/
4234
COPY setup.py /TensorPy/
4335
COPY tensorpy /TensorPy/tensorpy/
4436
COPY examples /TensorPy/examples/
45-
COPY third_party/docker /TensorPy/third_party/docker/
46-
COPY third_party/docker/run_docker_test.sh /TensorPy/
47-
RUN cd /TensorPy && ls && ./third_party/docker/docker_install.sh
37+
COPY integrations/docker/run_docker_test.sh /TensorPy/
38+
RUN cd /TensorPy && ls && ./install.sh
4839
RUN cd /TensorPy && pip install -r requirements.txt
4940

5041
#===================
5142
# Create entrypoint
5243
#===================
53-
COPY third_party/docker/docker-entrypoint.sh /
44+
COPY integrations/docker/docker-entrypoint.sh /
5445
ENTRYPOINT ["/docker-entrypoint.sh"]
5546
CMD ["/bin/bash"]

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111

1212
(**Upgraded** since that video was released!)
1313

14-
You can use TensorPy to classify images by simply passing a URL on the command line, or by using TensorPy in your Python programs. **[TensorFlow](https://www.tensorflow.org/)** does all the real work. TensorPy also simplifies TensorFlow installation by automating several setup steps into a single script (See **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** and **[python3_install.sh](https://github.com/TensorPy/TensorPy/blob/master/python3_install.sh)** for details).
14+
You can use TensorPy to classify images by simply passing a URL on the command line, or by using TensorPy in your Python programs. **[TensorFlow](https://www.tensorflow.org/)** does all the real work. TensorPy also simplifies TensorFlow installation by automating several setup steps into a single script (See **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** for details).
1515

1616
(Read **[how_tensorpy_works](https://github.com/TensorPy/TensorPy/blob/master/help_docs/how_tensorpy_works.md)** for a detailed explanation of how TensorPy works.)
1717

1818

1919
## Setup Steps for Mac & Ubuntu/Linux
2020

21-
(**Windows & Docker users**: See the **[Docker ReadMe](https://github.com/TensorPy/TensorPy/blob/master/third_party/docker/ReadMe.md)** for running on a Docker machine. Windows requires Docker to run TensorFlow.)
21+
(**Windows & Docker users**: See the **[Docker ReadMe](https://github.com/TensorPy/TensorPy/blob/master/integrations/docker/ReadMe.md)** for running on a Docker machine. Windows requires Docker to run TensorFlow.)
2222

2323
#### **Step 1:** Create and activate a virtual environment named "tensorpy"
2424

@@ -33,18 +33,12 @@ cd TensorPy
3333

3434
#### **Step 3:** Install TensorPy, TensorFlow, and ImageNet/Inception
3535

36-
For **Python 2.7** users, use **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** to install everything you need.
36+
Use **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** to install everything you need.
3737

3838
```bash
3939
./install.sh
4040
```
4141

42-
For **Python 3** users, use **[python3_install.sh](https://github.com/TensorPy/TensorPy/blob/master/python3_install.sh)** to install everything you need.
43-
44-
```bash
45-
./python3_install.sh
46-
```
47-
4842
#### **Step 4:** Run the examples
4943

5044
(NOTE: Run times may vary depending on your Internet connection and computer's CPU speed.)
@@ -81,8 +75,6 @@ classify examples/images/
8175

8276
#### **Examples in Python programs:**
8377

84-
*(**NOTE**: If you're using Python 3 instead of Python 2.7, replace "``python``" with "``python3``" on the command line.)*
85-
8678
Classify an image from a local file path using a Python script: (See **[test_python_file_classify.py](https://github.com/TensorPy/TensorPy/blob/master/examples/test_python_file_classify.py)** for details.)
8779

8880
```bash

help_docs/pip_installation.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
### Pip Installation Instructions
22

3-
Ubuntu/Linux
3+
Ubuntu/Linux:
44

55
```bash
66
sudo apt-get install python-pip python-dev
77
```
88

9-
Mac OS X
9+
Mac OS X:
1010

1111
```bash
1212
sudo easy_install pip
1313
```
14+
15+
OR
16+
17+
```bash
18+
python -m pip install -U pip
19+
```

help_docs/virtualenv_instructions.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
### Virtual Environment Setup Tutorial
22

3-
First:
3+
First, install virtualenv / virtualenvwrapper:
44

55
```bash
6-
sudo pip install virtualenv
7-
sudo pip install virtualenvwrapper
6+
python -m pip install virtualenv
7+
python -m pip install virtualenvwrapper
88
export WORKON_HOME=$HOME/.virtualenvs
99
source /usr/local/bin/virtualenvwrapper.sh
1010
```
1111

12-
Next, follow the command depending on the system you're using:
12+
If you add ``source /usr/local/bin/virtualenvwrapper.sh`` to your local bash file (``~/.bash_profile`` on Mac, ``~/.bashrc`` on Linux), virtualenvwrapper commands will be available to you whenever you open a new command prompt. You can then use the following commands to make those changes active.
1313

1414
Mac users: ``source ~/.bash_profile``
1515
Linux users: ``source ~/.bashrc``
@@ -28,7 +28,6 @@ deactivate
2828

2929
You can always jump back in later:
3030

31-
(If you're using ``virtualenvwrapper``):
3231
```bash
3332
workon tensorpy
3433
```

install.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# Installs TensorPy, TensorFlow, ImageNet, and required dependancies
2-
# (Made for Python 2.7)
32

4-
pip install --upgrade pip
5-
echo "Installing TensorPy for Python 2.7:"
3+
python -m pip install --upgrade pip
4+
echo "Installing TensorPy:"
65
pip install -r requirements.txt --upgrade
76
python setup.py develop
87
value="$(uname)"
9-
if [ $value == "Linux" ]
8+
if [ $value = "Linux" ]
109
then
1110
echo "Initializing TensorFlow setup on a Linux machine..."
12-
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp27-none-linux_x86_64.whl
11+
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp27-none-linux_x86_64.whl
1312
pip install --ignore-installed --upgrade $TF_BINARY_URL
14-
elif [ $value == "Darwin" ]
13+
elif [ $value = "Darwin" ]
1514
then
1615
echo "Initializing TensorFlow setup on a MAC..."
17-
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.2.1-py2-none-any.whl
18-
pip install --ignore-installed --upgrade $TF_BINARY_URL
16+
pip install --upgrade tensorflow
1917
else
2018
echo "Incompatible machine for TensorFlow. Exiting script..."
2119
fi
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## Third-Party / Integrations
1+
## Integrations
22

33
This folder contains TensorPy integrations
File renamed without changes.

python3_install.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)