From f4ee60b7d0c3cfa376f283875834c413ac71b513 Mon Sep 17 00:00:00 2001 From: mapingshuo Date: Mon, 2 Sep 2019 09:53:29 +0800 Subject: [PATCH] Imdb train demo2 (#19572) * add place to reader, remove snappy dependency * remove snappy dependency from train demo test=develop --- paddle/fluid/train/demo/CMakeLists.txt | 6 +----- paddle/fluid/train/imdb_demo/CMakeLists.txt | 6 +----- paddle/fluid/train/imdb_demo/demo_trainer.cc | 1 + 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/paddle/fluid/train/demo/CMakeLists.txt b/paddle/fluid/train/demo/CMakeLists.txt index 4e87f330e03..289dd9869bd 100644 --- a/paddle/fluid/train/demo/CMakeLists.txt +++ b/paddle/fluid/train/demo/CMakeLists.txt @@ -16,15 +16,11 @@ include_directories("${PADDLE_LIB}/third_party/install/protobuf/include") include_directories("${PADDLE_LIB}/third_party/install/glog/include") include_directories("${PADDLE_LIB}/third_party/install/gflags/include") include_directories("${PADDLE_LIB}/third_party/install/xxhash/include") -include_directories("${PADDLE_LIB}/third_party/install/snappy/include") -include_directories("${PADDLE_LIB}/third_party/install/snappystream/include") include_directories("${PADDLE_LIB}/third_party/install/zlib/include") include_directories("${PADDLE_LIB}/third_party/boost") include_directories("${PADDLE_LIB}/third_party/eigen3") -link_directories("${PADDLE_LIB}/third_party/install/snappy/lib") -link_directories("${PADDLE_LIB}/third_party/install/snappystream/lib") link_directories("${PADDLE_LIB}/third_party/install/protobuf/lib") link_directories("${PADDLE_LIB}/third_party/install/glog/lib") link_directories("${PADDLE_LIB}/third_party/install/gflags/lib") @@ -74,5 +70,5 @@ target_link_libraries(demo_trainer ${ARCHIVE_END} ${MATH_LIB} ${MKLDNN_LIB} - glog gflags protobuf snappystream snappy z xxhash + glog gflags protobuf z xxhash ${EXTERNAL_LIB}) diff --git a/paddle/fluid/train/imdb_demo/CMakeLists.txt b/paddle/fluid/train/imdb_demo/CMakeLists.txt index c9734378028..d12069169eb 100644 --- a/paddle/fluid/train/imdb_demo/CMakeLists.txt +++ b/paddle/fluid/train/imdb_demo/CMakeLists.txt @@ -16,15 +16,11 @@ include_directories("${PADDLE_LIB}/third_party/install/protobuf/include") include_directories("${PADDLE_LIB}/third_party/install/glog/include") include_directories("${PADDLE_LIB}/third_party/install/gflags/include") include_directories("${PADDLE_LIB}/third_party/install/xxhash/include") -include_directories("${PADDLE_LIB}/third_party/install/snappy/include") -include_directories("${PADDLE_LIB}/third_party/install/snappystream/include") include_directories("${PADDLE_LIB}/third_party/install/zlib/include") include_directories("${PADDLE_LIB}/third_party/boost") include_directories("${PADDLE_LIB}/third_party/eigen3") -link_directories("${PADDLE_LIB}/third_party/install/snappy/lib") -link_directories("${PADDLE_LIB}/third_party/install/snappystream/lib") link_directories("${PADDLE_LIB}/third_party/install/protobuf/lib") link_directories("${PADDLE_LIB}/third_party/install/glog/lib") link_directories("${PADDLE_LIB}/third_party/install/gflags/lib") @@ -74,5 +70,5 @@ target_link_libraries(demo_trainer ${ARCHIVE_END} ${MATH_LIB} ${MKLDNN_LIB} - glog gflags protobuf snappystream snappy z xxhash + glog gflags protobuf z xxhash ${EXTERNAL_LIB}) diff --git a/paddle/fluid/train/imdb_demo/demo_trainer.cc b/paddle/fluid/train/imdb_demo/demo_trainer.cc index e502635b007..d45edd563f0 100644 --- a/paddle/fluid/train/imdb_demo/demo_trainer.cc +++ b/paddle/fluid/train/imdb_demo/demo_trainer.cc @@ -149,6 +149,7 @@ int main(int argc, char* argv[]) { dataset_ptr->GetReaders(); PADDLE_ENFORCE_EQ(readers.size(), 1, "readers num should be equal to thread num"); + readers[0]->SetPlace(paddle::platform::CPUPlace()); const std::vector& input_feed_names = readers[0]->GetUseSlotAlias(); for (auto name : input_feed_names) { -- GitLab