Code Monkey home page Code Monkey logo

Comments (6)

aixier avatar aixier commented on May 22, 2024 1

强制转换就行了 im_info= np.array([800.,800.,1.], dtype='float32')

from paddledetection.

qingqing01 avatar qingqing01 commented on May 22, 2024

@aixier 请给下导出模型时的运行命令,注意模型要加载通过指定weights正确设置~

[inference_program, feed_target_names, fetch_targets] = fluid.io.load_inference_model(dirname=save_freeze_dir, executor=exe)

中最好指定下 model_filenameparams_filename的名字。

from paddledetection.

aixier avatar aixier commented on May 22, 2024

python tools/export_model.py -c configs/dcn/cascade_rcnn_dcn_r50_fpn_1x.yml --output_dir=./inference_model_cas -o weights=/home/aistudio/work/PaddleDetection/ResNet50_cos_pretrained.tar YoloTestFeed.image_shape=[3,448,448] @qingqing01

from paddledetection.

qingqing01 avatar qingqing01 commented on May 22, 2024

@aixier 保存模型选错了,请注意选择cascade_rcnn_dcn_r50_fpn_1x对应的模型是:
https://paddlemodels.bj.bcebos.com/object_detection/cascade_rcnn_dcn_r50_fpn_1x.tar

另外:

[inference_program, feed_target_names, fetch_targets] = fluid.io.load_inference_model(dirname=save_freeze_dir, executor=exe)

中最好指定下 model_filename 和 params_filename的名字。

from paddledetection.

aixier avatar aixier commented on May 22, 2024

可以load了
[inference_program, feed_target_names, fetch_targets] = fluid.io.load_inference_model(dirname=path, executor=exe, model_filename="model", params_filename="params")
但是设置: im_info= np.array([800.,800.,1.])
然后
batch_outputs = exe.run(inference_program,
feed={feed_target_names[0]: tensor_img,
feed_target_names[1]: im_info,
feed_target_names[2]: image_shape[np.newaxis, :]},
fetch_list=fetch_targets,
return_numpy=False)

会报错
PaddleCheckError: Tensor holds the wrong type, it holds double, but desires to be float at [D:\1.6.1\paddle\paddle/fluid
/framework/tensor_impl.h:30]
@qingqing01

from paddledetection.

qingqing01 avatar qingqing01 commented on May 22, 2024

@aixier 既然解决了,那就close了

from paddledetection.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.