Skip to content

Commit

Permalink
fixes for linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
xbpeng committed May 21, 2016
1 parent acb9b7a commit f6d1b97
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ This section covers some of the steps to setup and compile the code. The softwar
6. Json_cpp (https://github.com/open-source-parsers/jsoncpp)
7. Eigen (http://eigen.tuxfamily.org/index.php?title=Main_Page)
8. bits
sudo apt-get install gcc-4.9-multilib g++-4.9-multilib
sudo apt-get install gcc-4.9-multilib g++-4.9-multilib
11. LodePNG
https://github.com/lvandeve/lodepng


### Windows
Expand Down
22 changes: 11 additions & 11 deletions learning/AsyncSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ class cSolverAsync : public cCaffeSolver<tSolverType>
cSolverAsync(const caffe::SolverParameter& param)
: cCaffeSolver<tSolverType>(param) {};
virtual ~cSolverAsync() {};

virtual void ApplySteps(int steps);
};

template <typename tSolverType>
void cSolverAsync<tSolverType>::ApplySteps(int steps) {
std::vector<caffe::Blob<cNeuralNet::tNNData>*> bottom_vec;
const int start_iter = iter_;
const int stop_iter = iter_ + steps;
const int start_iter = cSolverAsync<tSolverType>::iter_;
const int stop_iter = cSolverAsync<tSolverType>::iter_ + steps;

while (iter_ < stop_iter) {
ApplyUpdate();
++iter_;
while (cSolverAsync<tSolverType>::iter_ < stop_iter) {
cSolverAsync<tSolverType>::ApplyUpdate();
++cSolverAsync<tSolverType>::iter_;

caffe::SolverAction::Enum request = GetRequestedAction();
caffe::SolverAction::Enum request = cSolverAsync<tSolverType>::GetRequestedAction();

// Save a snapshot if needed.
if ((param_.snapshot()
&& iter_ % param_.snapshot() == 0
if ((cSolverAsync<tSolverType>::param_.snapshot()
&& cSolverAsync<tSolverType>::iter_ % cSolverAsync<tSolverType>::param_.snapshot() == 0
&& caffe::Caffe::root_solver()) ||
(request == caffe::SolverAction::SNAPSHOT)) {
Snapshot();
cSolverAsync<tSolverType>::Snapshot();
}
if (caffe::SolverAction::STOP == request) {
requested_early_exit_ = true;
cSolverAsync<tSolverType>::requested_early_exit_ = true;
// Break out of training loop.
break;
}
Expand Down
4 changes: 2 additions & 2 deletions learning/NNSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ template <typename tSolverType>
cNeuralNet::tNNData cCaffeSolver<tSolverType>::ForwardBackward()
{
cNeuralNet::tNNData loss = 0;
net_->ClearParamDiffs();
loss = net_->ForwardBackward();
this->GetNet()->ClearParamDiffs();
loss = this->GetNet()->ForwardBackward();
return loss;
};

Expand Down
2 changes: 1 addition & 1 deletion render/TextureDesc.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "TextureDesc.h"
#include <assert.h>
#include "LodePNG\lodepng.h"
#include "LodePNG/lodepng.h"

std::stack<cTextureDesc::tTexEntry> cTextureDesc::mTexStack = std::stack<cTextureDesc::tTexEntry>();
cTextureDesc::tTexEntry::tTexEntry()
Expand Down

0 comments on commit f6d1b97

Please sign in to comment.