Keson96 / ResNet_LibTorch

A small example of using new PyTorch C++ frontend to implement ResNet
43 stars 13 forks source link

std::shared_ptr<torch::nn::Module> has no member 'value' #3

Open bknhatice opened 4 years ago

bknhatice commented 4 years ago

Hi,

for(auto m: this->modules()){ if(m.value.name() == "torch::nn::Conv2dImpl"){

error: 'class std::shared_ptr' has no member named 'value'

I would be happy if you help. Best regards,

xq114 commented 4 years ago

These codes do not work for libtorch 1.5 now. Many of them are deprecated or deleted from the framework. You'd better rewrite it following the instructions in the pytorch documentation.

bknhatice commented 4 years ago

Thank you, I tried for libtorch 1.3 again i got the same error. which version should i use?

xq114 commented 4 years ago

@bknhatice According to the commit time I think libtorch 0.3 or 0.4 may be suitable for this code, I didn't try it though.

bknhatice commented 4 years ago

Thank you, I will try for libtorch 0.3 or 0.4.