chen1474147 / Deep3DPose

MIT License
65 stars 32 forks source link

Could you please explain, how to train and test POSE ESTIMATION on this caffe version? #2

Closed priyapaul closed 7 years ago

priyapaul commented 7 years ago

Is there any demo file, of how it works for this application, steps from data preparation, model selection? If not, could you please provide one? Where is the data located? How to pass it via arguments

Itried,

ppl4hi@HI-Z0FH9:~/CODES/Deep3DPose-master/5-caffe$ ./examples/adaptation/scripts/prepare_experiments.sh
 Downloading AlexNet reference model...
Downloading ImageNet aux data...
Preparing datasets...
Preparing directories for experiments...
ppl4hi@HI-Z0FH9:~/CODES/Deep3DPose-master/5-caffe$

But, the folder /5-caffe/examples/adaptation/datasets/ is empty, so it gives me error when training. What could be the reason?

May be because of this, when running train.sh script, i get error


ppl4hi@HI-Z0FH9:~/CODES/Deep3DPose-master/5-caffe$ ./examples/adaptation/experiments/amazon_to_webcam/scripts/train.sh
I0131 15:40:19.995388 22027 caffe.cpp:113] Use GPU with device ID 0
I0131 15:40:21.525190 22027 caffe.cpp:121] Starting Optimization
I0131 15:40:21.525326 22027 solver.cpp:34] Initializing solver from parameters:
test_iter: 795
test_interval: 10000
base_lr: 0.001
display: 100
max_iter: 50000
lr_policy: "inv"
gamma: 0.001
power: 0.75
momentum: 0.9
snapshot: 10000
snapshot_prefix: "/home/ppl4hi/CODES/Deep3DPose-master/5-caffe/examples/adaptation/experiments/amazon_to_webcam/snapshots/train"
solver_mode: GPU
net: "/home/ppl4hi/CODES/Deep3DPose-master/5-caffe/examples/adaptation/experiments/amazon_to_webcam/protos/train_val.prototxt"
I0131 15:40:21.525411 22027 solver.cpp:87] Creating training net from net file: /home/ppl4hi/CODES/Deep3DPose-master/5-caffe/examples/adaptation/experiments/amazon_to_webcam/protos/train_val.prototxt
I0131 15:40:21.526595 22027 net.cpp:257] The NetState phase (0) differed from the phase (1) specified by a rule in layer target_data
I0131 15:40:21.526620 22027 net.cpp:257] The NetState phase (0) differed from the phase (1) specified by a rule in layer target_domain_labels
I0131 15:40:21.526648 22027 net.cpp:257] The NetState phase (0) differed from the phase (1) specified by a rule in layer bottleneck_alias
I0131 15:40:21.526660 22027 net.cpp:257] The NetState phase (0) differed from the phase (1) specified by a rule in layer lp_accuracy
I0131 15:40:21.526957 22027 net.cpp:42] Initializing net from parameters:
name: "AlexNet for Office"
state {
  phase: TRAIN

.
.
.
.

The following is the error,


I0131 15:40:21.528966 22027 layer_factory.hpp:73] Creating layer source_data
I0131 15:40:21.529003 22027 net.cpp:84] Creating Layer source_data
I0131 15:40:21.529016 22027 net.cpp:338] source_data -> source_data
I0131 15:40:21.529047 22027 net.cpp:338] source_data -> lp_labels
I0131 15:40:21.529063 22027 net.cpp:113] Setting up source_data
F0131 15:40:21.529134 22027 db.hpp:116] Check failed: mdb_status == 0 (2 vs. 0) No such file or directory
*** Check failure stack trace: ***
    @     0x7fbb3dedadaa  (unknown)
    @     0x7fbb3dedace4  (unknown)
    @     0x7fbb3deda6e6  (unknown)
    @     0x7fbb3dedd687  (unknown)
    @     0x7fbb3e23370e  caffe::db::LMDB::Open()
    @     0x7fbb3e2d1a78  caffe::DataLayer<>::DataLayerSetUp()
    @     0x7fbb3e2fbe36  caffe::BaseDataLayer<>::LayerSetUp()
    @     0x7fbb3e2fbf39  caffe::BasePrefetchingDataLayer<>::LayerSetUp()
    @     0x7fbb3e251302  caffe::Net<>::Init()
    @     0x7fbb3e252dc2  caffe::Net<>::Net()
    @     0x7fbb3e25f5f0  caffe::Solver<>::InitTrainNet()
    @     0x7fbb3e26082e  caffe::Solver<>::Init()
    @     0x7fbb3e260b26  caffe::Solver<>::Solver()
    @           0x40d410  caffe::GetSolver<>()
    @           0x4075a3  train()
    @           0x405bb1  main
    @     0x7fbb3d3ecf45  (unknown)
    @           0x40615d  (unknown)
    @              (nil)  (unknown)
Aborted (core dumped)

Thanks in advance.

priyapaul commented 7 years ago

I find that, in the script(prepare_experiment.sh), I see a folder, but cant locate it. May be that is the problem?

domain_adaptation_images

# Prepare lmdb databases for the Office dataset.
echo "[*] Preparing datasets..."
mkdir ./examples/adaptation/datasets
for DOMAIN in amazon webcam dslr; do
    python ./examples/adaptation/scripts/convert_data.py \
        -s $OFFICE_DIR/domain_adaptation_images/ \
        -t ./examples/adaptation/datasets/ \
        -d $DOMAIN -i 1 >/dev/null 2>/dev/null
done
priyapaul commented 7 years ago

So, basically its abou the arguments with which prepare_experiment is called!. So getting back to the 1st questions. Where is the test and train data located?

If possible could you also mention how to do this? like, what and how to run ?

Also, in the convert_data.py, What should be the following changed to?

# Make sure that caffe is on the python path:
caffe_root = '/home/yganin/Arbeit/Projects/NN/skaffe'  # this file is expected to be in {caffe_root}/examples
chen1474147 commented 7 years ago

Well, first, my caffe is modified by ICML paper https://github.com/ddtm/caffe. Then, based on this version, I change some layers, adding listener. Second, the demo you run is the one in ICML, not my demo. I didn;t supply any demo file.

chen1474147 commented 7 years ago

To run my demo, first you need to prepare two pieces of data. Say, one is real image, for example, you can download LSP dataset(a real sports images). the other is synthetic data, you can render them by my program.

Then, to train the data, you need to convert the real image and synthetic image into lmdb format. Then you need to set their label, say, synthetic data is 0 and real data is 1.

Next, you can run my program. You should set grl_train, grl_interval and fc_interval in solver.prototxt.

I would recommend you to read my paper to understand the domain adaptation part.

Also, you can write an email to me and I can supply my setting file. my email is chen1474147@gmail.com

chen1474147 commented 7 years ago

Do you want to use my caffe version to do some domain adaptation task?

priyapaul commented 7 years ago

Not(only) for adaptation, but for human pose estimation. But, good if domain adaptation is included. I would contact you. Thanks for your replies.

priyapaul commented 7 years ago

Is this repository's caffe version, only a part of the full train-test caffe version for estimating the pose? Because, I expect, the image and 3d Joint positions as the input and ground truth respectively for training. And for testing, if given an image, it would predict the joint positions. It seems that I am mistaken! :(

chen1474147 commented 7 years ago

if you want to use my caffe model(http://irc.cs.sdu.edu.cn/Deep3DPose/model/model.zip), you can use it in a normal caffe version.

If you want to train it by domain adaptation part, you should use my caffe version .

priyapaul commented 7 years ago

Thank you very much for your time and patience !