GithubHelp home page GithubHelp logo

Comments (7)

peterjc123 avatar peterjc123 commented on May 2, 2024

It's a known issue that in some legacy versions of PyTorch, the following code won't be traced.

class Model(nn.Module):
    def forward(self, x):
        // ...
        cat_10 = self.float_functional_simple_9.cat([getitem_15, backbone_stage3_5_branch_main_7], 1)
        data_9 = cat_10.data
        size_9 = data_9.size()
        // ...

but it will work when you write like this.

class Model(nn.Module):
    def forward(self, x):
        // ...
        cat_10 = self.float_functional_simple_9.cat([getitem_15, backbone_stage3_5_branch_main_7], 1)
        size_9 = cat_10.size()
        // ...

We will work on our code generator and tracer to get rid of the .data calls.

from tinyneuralnetwork.

peterjc123 avatar peterjc123 commented on May 2, 2024

@liamsun2019 We pushed a fix for the issue and the given model can be converted locally. Would you please try to remove the existing model description file and try again?

from tinyneuralnetwork.

liamsun2019 avatar liamsun2019 commented on May 2, 2024

Big thanks. I will try it out ASAP.

from tinyneuralnetwork.

peterjc123 avatar peterjc123 commented on May 2, 2024

I'll close this one for now. If you disagree, please feel free to reopen it.

from tinyneuralnetwork.

liamsun2019 avatar liamsun2019 commented on May 2, 2024

No problem,thanks.

from tinyneuralnetwork.

liamsun2019 avatar liamsun2019 commented on May 2, 2024

The converted tflite model cannot pass benchmark test:
./linux_x86-64_benchmark_model --graph=qat_model.tflite
STARTING!
Log parameter values verbosely: [0]
Graph: [qat_model.tflite]
Loaded model qat_model.tflite
ERROR: tensorflow/lite/kernels/concatenation.cc:179 t->params.scale != output->params.scale (3 != 2018333616)
ERROR: Node number 12 (CONCATENATION) failed to prepare.
Failed to allocate tensors!
Benchmarking failed.

Similar errors happen when doing inference with the tflite model if invoking interpreter.allocate_tensors()

from tinyneuralnetwork.

peterjc123 avatar peterjc123 commented on May 2, 2024

@liamsun2019 This is because of something else. I've discussed with you through online messages. Next time, please open a new issue for that. Thanks.

from tinyneuralnetwork.

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.