Re: Private: Re: [NNStreamer Technical Discuss] Which version of pytorch is available with nnstreamer-pytorch 2.1.0.0-0~202111300837~ubuntu18.04.1?


MyungJoo Ham
 

According to the log you've send in the previous message, calling pytorch's load function has failed:

  try {

#ifdef PYTORCH_VER_ATLEAST_1_2_0

    model = std::make_shared<torch::jit::script::Module> (torch::jit::load (model_path));

#else

    model = torch::jit::load (model_path);

#endif

  } catch (const std::invalid_argument &ia) {

    ml_loge ("Invalid argument while loading the model: %s"ia.what ());

    return -1;

  } catch (const std::exception &ex) {

    ml_loge ("Exception while loading the model: %s"ex.what ());

    return -1;

 

the exception is from "Exception while loading the model", which means that the model you've entered

has failed with "load()" function.

Please check if the pytorch invoked by nnstreamer is correct (depending on your own shard-library configurations, different pytorch might be invoked when you call it via nnstreamer/gstreamer). Check if the corresponding pytorch instance is compatible with your model. Then, check if your tensor_filter arguments, "inputname", "outputname" are correct, too.

 

Cheers,

MyungJoo.

ps. Please keep this thread public.
ps.2 If you want more active & efficient discussion, you can try github/issue

 

--------- Original Message ---------

Sender : 이병헌 <byungs286@...>

Date : 2021-12-02 15:51 (GMT+9)

Title : Private: Re: [NNStreamer Technical Discuss] Which version of pytorch is available with nnstreamer-pytorch 2.1.0.0-0~202111300837~ubuntu18.04.1?

 

Thanks for reply 

 

I've tried your advice as like below

 

  const char *string = "rtspsrc location=rtsp://address:port/mount latency=0 protocols=4 ! \

rtph265depay ! \

avdec_h265 ! \

videoscale ! \

videoconvert ! \

video/x-raw,format=RGB,width=640,height=640 ! \

tensor_converter ! \

tensor_transform mode=typecast option=float32 ! \

tensor_filter framework=pytorch \

model=../../tf_model/yolov5s.torchscript.pt \

input=3:640:640:1 inputname=x inputtype=float32 \

output=1:25200:85 outputname=416 outputtype=float32 ! \

tensor_sink name=tensor_sink";

 

but I still have same error as below..

 

failed to initialize the object: PyTorch

0:00:00.159368517   264 0x564b2683b140 WARN                GST_PADS gstpad.c:1149:gst_pad_set_active:<tensorfilter0:sink> Failed to activate pad

** Message06:37:13.822: gpu = 0, accl = cpu

 

** (tester:264): CRITICAL **: 06:37:13.825: Exception while loading the model: 

 

** (tester:264): CRITICAL **: 06:37:13.825: Failed to load model

 

 

failed to initialize the object: PyTorch

 

Is there have any other problem in that pipeline?

 

 

 

Join {nnstreamer-technical-discuss@lists.lfaidata.foundation to automatically receive all group messages.