Skip to content

Commit

Permalink
[OSX] Make OSX Travis work
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Sep 27, 2015
1 parent 9f0f7cd commit f92c496
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
sudo: false
# Enabling test on Linux and OS X
os:
- linux
- osx

# Use Build Matrix to do lint and build seperately
Expand Down
5 changes: 2 additions & 3 deletions scripts/travis_osx_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ conda update -q conda
# Useful for debugging any issues with conda
conda info -a

if [ ${TASK} == "python-package3" ]; then
if [ ${TASK} == "package3" ]; then
conda create -n myenv python=3.4
alias python3=python
else
conda create -n myenv python=2.7
fi
source activate myenv
conda install numpy scipy matplotlib nose
python -m pip install graphviz
python -m pip install graphviz
15 changes: 11 additions & 4 deletions scripts/travis_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ fi
# prereqs for things that need make
cp make/config.mk config.mk

export NOSE3=nosetests3
export PYTHON3=python3
if [ ${TRAVIS_OS_NAME} == "osx" ]; then
source scripts/travis_osx_install.sh
echo "USE_BLAS=apple" >> config.mk
echo "USE_OPENMP=0" >> config.mk
alias nosetests='python -m noise'
alias nosetests3='python -m noise'
alias nosetests='python -m nose'
export NOSE3='python -m nose'
export PYTHON3=python
else
echo "USE_BLAS=blas" >> config.mk
echo "USE_CUDNN=0" >> config.mk
Expand All @@ -46,6 +49,7 @@ fi
if [ ${TASK} == "python" ]; then
echo "USE_CUDA=0" >> config.mk
make all || exit -1
python --version
export MXNET_ENGINE_TYPE=ThreadedEngine
nosetests tests/python/unittest || exit -1
nosetests tests/python/train || exit -1
Expand All @@ -55,14 +59,16 @@ if [ ${TASK} == "python3" ]; then
echo "USE_CUDA=0" >> config.mk
make all || exit -1
export MXNET_ENGINE_TYPE=ThreadedEngine
nosetests3 tests/python/unittest || exit -1
nosetests3 tests/python/train || exit -1
${PYTHON3} --version
${NOSE3} tests/python/unittest || exit -1
${NOSE3} tests/python/train || exit -1
fi

if [ ${TASK} == "python_naive" ]; then
echo "USE_CUDA=0" >> config.mk
make all || exit -1
export MXNET_ENGINE_TYPE=NaiveEngine
python --version
nosetests tests/python/unittest || exit -1
nosetests tests/python/train || exit -1
fi
Expand All @@ -71,6 +77,7 @@ if [ ${TASK} == "python_perdev" ]; then
echo "USE_CUDA=0" >> config.mk
make all || exit -1
export MXNET_ENGINE_TYPE=ThreadedEnginePerDevice
python --version
nosetests tests/python/unittest || exit -1
nosetests tests/python/train || exit -1
fi
Expand Down
11 changes: 1 addition & 10 deletions src/io/image_augmenter.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ struct ImageAugmentParam : public dmlc::Parameter<ImageAugmentParam> {
class ImageAugmenter {
public:
// contructor
ImageAugmenter(void)
: tmpres_(false) {
ImageAugmenter(void) {
#if MXNET_USE_OPENCV
rotateM_ = cv::Mat(2, 3, CV_32F);
#endif
Expand Down Expand Up @@ -211,20 +210,12 @@ class ImageAugmenter {
#endif

private:
// temp input space
mshadow::TensorContainer<cpu, 3> tmpres_;
// mean image
mshadow::TensorContainer<cpu, 3> meanimg_;
/*! \brief temp space */
mshadow::TensorContainer<cpu, 3> img_;
#if MXNET_USE_OPENCV
// temporal space
cv::Mat temp_;
// rotation param
cv::Mat rotateM_;
// whether the mean file is ready
#endif
bool meanfile_ready_;
// parameters
ImageAugmentParam param_;
/*! \brief list of possible rotate angle */
Expand Down

0 comments on commit f92c496

Please sign in to comment.