mitmul / deeppose

DeepPose implementation in Chainer
http://static.googleusercontent.com/media/research.google.com/ja//pubs/archive/42237.pdf
GNU General Public License v2.0
408 stars 129 forks source link

CPU Mode Predict_flic.py #8

Open gsrujana opened 9 years ago

gsrujana commented 9 years ago

When running visualization code I got error:

Traceback (most recent call last): File "scripts/predict_flic.py", line 211, in test(args) File "scripts/predict_flic.py", line 118, in test pred = preds[n] TypeError: 'Variable' object does not support indexing

It worked when I changed pred = preds[n] to pred = preds.data[n]. It is assigned it correctly for GPU mode with

    if args.gpu >= 0:
        preds = cuda.to_cpu(preds.data)
        input_data = cuda.to_cpu(input_data)
        labels = cuda.to_cpu(labels)

But same should be done for CPU mode.