Skip to content

Commit

Permalink
update docs; fix predictor
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed Jul 22, 2018
1 parent b673b24 commit 101d7aa
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 34 deletions.
23 changes: 14 additions & 9 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
An issue has to be one of the following:
1. Unexpected Problems / Potential Bugs
2. Feature Requests
3. Usage Questions
- [ ] Unexpected Problems / Potential Bugs
- [ ] Feature Requests
- [ ] Questions on Using/Understanding Tensorpack

For any unexpected problems, __PLEASE ALWAYS INCLUDE__:
1. What you did:
Expand All @@ -20,19 +20,24 @@ For any unexpected problems, __PLEASE ALWAYS INCLUDE__:
+ Tensorpack version: `python -c 'import tensorpack; print(tensorpack.__version__)'`.
You can install Tensorpack master by `pip install -U git+https://github.com/ppwwyyxx/tensorpack.git`.:
+ Hardware information, if relevant.
5. About efficiency, PLEASE first read http://tensorpack.readthedocs.io/en/latest/tutorial/performance-tuning.html

For efficiency issues, PLEASE first read http://tensorpack.readthedocs.io/en/latest/tutorial/performance-tuning.html

Feature Requests:
+ You can implement a lot of features by extending tensorpack
+ You can implement a lot of features by extending Tensorpack
(See http://tensorpack.readthedocs.io/en/latest/tutorial/index.html#extend-tensorpack).
It does not have to be added to tensorpack unless you have a good reason.
+ We don't take feature requests for examples or implementing papers.
It does not have to be added to Tensorpack unless you have a good reason.
+ "Could you improve/implement an example/paper ?"
-- the answer is: we don't know, and we don't take feature requests for
examples. You should do it yourself with Tensorpack. If you don't know how to
do it, you may ask a usage question.

Usage Questions:

+ Read the [tutorials](http://tensorpack.readthedocs.io/en/latest/tutorial/index.html#user-tutorials) first.
+ We answer "HOW to do X in tensorpack" for a well-defined X.
+ We answer "HOW to do X with Tensorpack" for a well-defined X.
We also answer "HOW/WHY Tensorpack does X" for some X that Tensorpack or its examples are doing.
We don't answer general machine learning questions,
such as "what networks to use" or "I don't understand the paper".
such as "why my training doesn't converge", "what networks to use" or "I don't understand the paper".

You can also use gitter (https://gitter.im/tensorpack/users) for more casual discussions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ matrix:
env: TF_VERSION=1.3.0 TF_TYPE=release
- os: linux
python: 2.7
env: TF_VERSION=1.8.0 TF_TYPE=release
env: TF_VERSION=1.9.0 TF_TYPE=release
- os: linux
python: 3.5
env: TF_VERSION=1.8.0 TF_TYPE=release PYPI=true
env: TF_VERSION=1.9.0 TF_TYPE=release PYPI=true
- os: linux
python: 2.7
env: TF_TYPE=nightly
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,10 @@ demonstrating its flexibility for actual research.

Dependencies:

+ Python 2.7 or 3.3+
+ Python 2.7 or 3.3+. Python 2.7 is supported until [it retires in 2020](https://pythonclock.org/).
+ Python bindings for OpenCV (Optional, but required by a lot of features)
+ TensorFlow >= 1.3.0 (Optional if you only want to use `tensorpack.dataflow` alone as a data processing library)
+ TensorFlow >= 1.3. (If you only want to use `tensorpack.dataflow` alone as a data processing library, TensorFlow is not needed)
```
# install git, then:
pip install --upgrade git+https://github.com/tensorpack/tensorpack.git
# or add `--user` to avoid system-wide installation.
```
Expand Down
3 changes: 2 additions & 1 deletion examples/FasterRCNN/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def nonlin(x):
def maybe_syncbn_scope():
if cfg.BACKBONE.NORM == 'SyncBN':
assert cfg.BACKBONE.FREEZE_AT == 2 # TODO add better support
with argscope(BatchNorm, training=None, sync_statistics='nccl'):
with argscope(BatchNorm, training=None,
sync_statistics='nccl' if cfg.TRAINER == 'replicated' else 'horovod'):
yield
else:
yield
Expand Down
2 changes: 1 addition & 1 deletion tensorpack/callbacks/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, op,
"""
Args:
op (tf.Operation or function): an Op, or a function that returns the Op in the graph.
The function will be called later (in the `setup_graph` callback).
The function will be called after the main graph has been created (in the `setup_graph` callback).
run_before (bool): run the Op before training
run_as_trigger (bool): run the Op on every :meth:`trigger()` call.
run_step (bool): run the Op every step (along with training)
Expand Down
24 changes: 6 additions & 18 deletions tensorpack/predict/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,32 +118,20 @@ def __init__(self, input_tensors, output_tensors,
else:
self._callable = None

def _do_call_old(self, dp):
feed = dict(zip(self.input_tensors, dp))
output = self.sess.run(self.output_tensors, feed_dict=feed)
return output
def _do_call(self, dp):
assert len(dp) == len(self.input_tensors), \
"{} != {}".format(len(dp), len(self.input_tensors))
if self.sess is None:
self.sess = tf.get_default_session()

def _do_call_new(self, dp):
if self._callable is None:
self._callable = self.sess.make_callable(
fetches=self.output_tensors,
feed_list=self.input_tensors,
accept_options=self.ACCEPT_OPTIONS)
# run_metadata = tf.RunMetadata()
# options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
ret = self._callable(*dp)
return ret

def _do_call(self, dp):
assert len(dp) == len(self.input_tensors), \
"{} != {}".format(len(dp), len(self.input_tensors))
if self.sess is None:
self.sess = tf.get_default_session()

if self._use_callable:
return self._do_call_new(dp)
else:
return self._do_call_old(dp)
return self._callable(*dp)


class OfflinePredictor(OnlinePredictor):
Expand Down

0 comments on commit 101d7aa

Please sign in to comment.