diff --git a/README.md b/README.md index 23138a067edfd6dcd4c13d9fe90397af074e6517..a95cbf30b6f877860ef5e46c0f7007a6bc5f0d0a 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,16 @@ # VisualDL (Visualize the Deep Learning) ## Introduction -VisualDL is a deep learning visualization tool that can help design deep learning jobs. -It includes features such as scalar, parameter distribution, model structure and image visualization. -Currently it is being developed at a high pace. +VisualDL is a deep learning visualization tool that can help design deep learning jobs. +It includes features such as scalar, parameter distribution, model structure and image visualization. +Currently it is being developed at a high pace. New features will be continuously added. -At present, most DNN frameworks use Python as their primary language. VisualDL supports Python by nature. +At present, most DNN frameworks use Python as their primary language. VisualDL supports Python by nature. Users can get plentiful visualization results by simply add a few lines of Python code into their model before training. - - -Besides Python SDK, VisualDL was writen in C++ on the low level. It also provides C++ SDK that + + +Besides Python SDK, VisualDL was writen in C++ on the low level. It also provides C++ SDK that can be integrated into other platforms. @@ -27,8 +27,8 @@ VisualDL now provides 4 components: - histogram ### Graph -Graph is compatible with ONNX(Open Neural Network Exchange)[https://github.com/onnx/onnx], -Cooperated with Python SDK, VisualDL can be compatible with most major DNN frameworks, including +Graph is compatible with ONNX(Open Neural Network Exchange)[https://github.com/onnx/onnx], +Cooperated with Python SDK, VisualDL can be compatible with most major DNN frameworks, including PaddlePaddle, PyTorch and MXNet.

@@ -75,7 +75,7 @@ logger = LogWriter(dir, sync_cycle=10) with logger.mode("train"): # create a scalar component called 'scalars/scalar0' scalar0 = logger.scalar("scalars/scalar0") - + # add some records during DL model running, lets start from another block. with logger.mode("train"): @@ -98,12 +98,12 @@ namepsace cp = visualdl::components; int main() { const std::string dir = "./tmp"; vs::LogWriter logger(dir, 10); - + logger.SetMode("train"); auto tablet = logger.NewTablet("scalars/scalar0"); - + cp::Scalar scalar0(tablet); - + for (int step = 0; step < 1000; step++) { float v = (float)std::rand() / RAND_MAX; scalar0.AddRecord(step, v); @@ -131,7 +131,7 @@ Board also supports the parameters below for remote access: ### How to install ``` python setup.py bdist_wheel -pip install --upgrade dist/visualdl-0.0.1-py2-none-any.whl +pip install --upgrade dist/visualdl-*.whl ``` ### Run a demo from scratch @@ -144,6 +144,6 @@ that will start a server locally. ### Contribute -VisualDL is initially created by [PaddlePaddle](http://www.paddlepaddle.org/) and -[ECharts](http://echarts.baidu.com/). +VisualDL is initially created by [PaddlePaddle](http://www.paddlepaddle.org/) and +[ECharts](http://echarts.baidu.com/). We welcome everyone to use, comment and contribute to Visual DL :) diff --git a/build.sh b/build.sh index 426c5aff590c9cb09b8e275604ae48485aa97403..fa76d1ff51c5d85814a1e3f3c57d80637bd0a8fc 100644 --- a/build.sh +++ b/build.sh @@ -23,7 +23,7 @@ build_frontend_fake() { build_backend() { cd $BUILD_DIR - cmake .. + cmake .. ${PYTHON_FLAGS} make -j2 } diff --git a/demo/mxnet/TUTORIAL_CN.md b/demo/mxnet/TUTORIAL_CN.md index 2ac270c6b625e714026e4e4ec77f3b13687b13f1..ae1e8bd895a2e83ae5f3346a152591cba614bab0 100644 --- a/demo/mxnet/TUTORIAL_CN.md +++ b/demo/mxnet/TUTORIAL_CN.md @@ -24,7 +24,7 @@ VisualDL的安装很简单。请按照VisualDL的[官方网站](https://github.c ``` python setup.py bdist_wheel -pip install --upgrade dist/visualdl-0.0.1-py2-none-any.whl +pip install --upgrade dist/visualdl-*.whl ``` ## 开始编写训练MNIST的程序 diff --git a/setup.py b/setup.py index 599c5dca50526418aee447a11c0f98bd273fde4a..23bbf0092c502a6ff7096327a2db063b36f1ee77 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ from distutils.spawn import find_executable from distutils import sysconfig, dep_util, log import setuptools.command.build_py import setuptools -from setuptools import setup, find_packages +from setuptools import setup, find_packages, Distribution, Extension import subprocess TOP_DIR = os.path.realpath(os.path.dirname(__file__)) @@ -79,22 +79,25 @@ datas = [] data_root = os.path.join(TOP_DIR, 'visualdl/server/dist') for root, dirs, files in os.walk(data_root): for filename in files: - path = 'dist/'+os.path.join(root, filename)[len(data_root)+1:] + path = 'dist/' + os.path.join(root, filename)[len(data_root) + 1:] datas.append(path) print datas setup( name="visualdl", version=VERSION_NUMBER, - author="PaddlePaddle and Echarts team.", - description="Visualize Deep Learning.", + author="PaddlePaddle and Echarts team", + description="Visualize Deep Learning", license=LICENSE, keywords="visualization deeplearning", long_description=read('README.md'), install_requires=install_requires, - package_data={'visualdl.server': datas, - 'visualdl':['core.so'], - 'visualdl.python':['core.so', 'dog.jpg']}, + package_data={ + 'visualdl.server': datas, + 'visualdl': ['core.so'], + 'visualdl.python': ['core.so', 'dog.jpg'] + }, packages=packages, + ext_modules=[Extension('_foo', ['stub.cc'])], scripts=['visualdl/server/visualDL', 'demo/vdl_scratch.py'], cmdclass=cmdclass) diff --git a/stub.cc b/stub.cc new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests.sh b/tests.sh index 12458d3fcf804376c30b5988fb40e205a3b30b2b..ace3f66e260012076096c3aeb531b50463807539 100644 --- a/tests.sh +++ b/tests.sh @@ -6,12 +6,13 @@ readonly TOP_DIR=$(pwd) readonly core_path=$TOP_DIR/build/visualdl/logic readonly python_path=$TOP_DIR/visualdl/python readonly max_file_size=1000000 # 1MB +readonly version_number=`cat VERSION_NUMBER` sudo="sudo" if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo=""; fi -if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O http://python-distribute.org/distribute_setup.py python distribute_setup.py curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py @@ -41,7 +42,7 @@ package() { cd $TOP_DIR python setup.py bdist_wheel - $sudo pip install dist/visualdl-0.0.1-py2-none-any.whl + $sudo pip install dist/visualdl-${version_number}-*.whl } backend_test() { diff --git a/visualdl/logic/CMakeLists.txt b/visualdl/logic/CMakeLists.txt index 415bd93438e31fe0938e7c4fe6da2fbac87d5b04..acee65cb97b49ad7e2d1c928ca6f3b7683cecbb0 100644 --- a/visualdl/logic/CMakeLists.txt +++ b/visualdl/logic/CMakeLists.txt @@ -18,12 +18,19 @@ add_dependencies(im storage_proto) add_dependencies(sdk entry storage storage_proto eigen3) ## pybind +set(OPTIONAL_LINK_FLAGS) + +if(NOT APPLE) + set(OPTIONAL_LINK_FLAGS "rt") +endif() + add_library(core SHARED ${PROJECT_SOURCE_DIR}/visualdl/logic/pybind.cc) + if (NOT ON_RELEASE) add_dependencies(core pybind python im entry tablet storage sdk protobuf glog eigen3) - target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf glog) + target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf glog ${OPTIONAL_LINK_FLAGS}) else() add_dependencies(core pybind python im entry tablet storage sdk protobuf eigen3) - target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf) + target_link_libraries(core PRIVATE pybind entry python im tablet storage sdk protobuf ${OPTIONAL_LINK_FLAGS}) endif() set_target_properties(core PROPERTIES PREFIX "" SUFFIX ".so")