Commit 0aa7446f authored by Yuxin Wu's avatar Yuxin Wu

start using pip to install

parent 8553816b
......@@ -6,19 +6,15 @@ cache:
pip: true
apt: true
addons:
apt:
sources:
ubuntu-toolchain-r-test
matrix:
fast_finish: true
include:
- os: linux
python: 2.7
env: TF_VERSION=1.0.0rc0 TF_TYPE=release
env: TF_VERSION=1.0.0rc1 TF_TYPE=release
- os: linux
python: 3.5
env: TF_VERSION=1.0.0rc0 TF_TYPE=release
env: TF_VERSION=1.0.0rc1 TF_TYPE=release
- os: linux
python: 2.7
env: TF_VERSION=0.12.1 TF_TYPE=nightly
......@@ -34,8 +30,9 @@ install:
# Here we use opencv-python to overcome some travis probelms.
# Users are not recommended to use opencv-python because it brings issues working on GPU
# together with tensorflow.
- if [ -e requirements.txt ]; then pip install -r requirements.txt;else pip install -r requirements.pip;fi
# - if [ -e requirements.txt ]; then pip install -r requirements.txt;else pip install -r requirements.pip;fi
- ./tests/install-tensorflow.sh
- pip install .
before_script:
- flake8 --version
......@@ -45,7 +42,7 @@ before_script:
script:
- flake8 .
- cd examples && flake8 .
- export PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR
# - export PYTHONPATH=$PYTHONPATH:$TRAVIS_BUILD_DIR
- cd $TRAVIS_BUILD_DIR && python tests/test_examples.py
notifications:
......
......@@ -54,20 +54,17 @@ With the above components defined, tensorpack trainer will run the training iter
Multi-GPU training is off-the-shelf by simply switching the trainer.
You can also define your own trainer for non-standard training (e.g. GAN).
## Dependencies:
## Install:
Dependencies:
+ Python 2 or 3
+ TensorFlow >= 1.0.0rc0
+ Python bindings for OpenCV
+ other requirements:
```
pip install --user -r requirements.txt
pip install --user -r opt-requirements.txt # (some optional dependencies required by certain submodule, you can install later if needed)
```
+ Enable `import tensorpack`:
+ (optional) use tcmalloc if running with large data
```
export PYTHONPATH=$PYTHONPATH:`readlink -f path/to/tensorpack`
git clone https://github.com/ppwwyyxx/tensorpack/ && cd tensorpack
pip install --user --upgrade .
pip install --user -r opt-requirements.txt # (some optional dependencies required by certain submodules, you can install later if prompted)
```
(or use `greadlink` from `coreutils` brew package if you're on OSX)
+ Use tcmalloc if running with large data
termcolor
numpy
tqdm
nltk
decorator
Sphinx==1.5.1
recommonmark==0.4.0
......@@ -39,5 +39,5 @@ To view the loss curve:
```bash
cat train_log/hed/stat.json | jq '.[] |
"\(.xentropy1)\t\(.xentropy2)\t\(.xentropy3)\t\(.xentropy4)\t\(.xentropy5)\t\(.xentropy6)"' -r | \
../../scripts/plot-point.py --legend 1,2,3,4,5,final --decay 0.8
tpk-plot-point --legend 1,2,3,4,5,final --decay 0.8
```
......@@ -48,6 +48,7 @@ for s in scripts:
setup(
version=__version__,
install_requires=req,
tests_require=['flake8']
extras_require={
'all': extra_req
},
......
......@@ -7,6 +7,7 @@ from contextlib import contextmanager
import numpy as np
# this function exists for backwards-compatibilty
def prediction_incorrect(logits, label, topk=1, name='incorrect_vector'):
"""
Args:
......
......@@ -155,9 +155,12 @@ class Trainer(object):
@property
def global_step(self):
try:
return self._starting_step + \
self.config.steps_per_epoch * (self.epoch_num - 1) + \
self.local_step + 1
except AttributeError:
return get_global_step_value()
def main_loop(self):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment