pytorch / glow

Compiler for Neural Network hardware accelerators
Apache License 2.0
3.22k stars 689 forks source link

Multiple tensorflow-lite models in one application #6045

Open AndersNeo opened 1 year ago

AndersNeo commented 1 year ago

I have generated code for multiple tensorflow-lite networks. I got the .o files. Now I'm trying to build all of them into one c++ application. But I get linker warnings when trying to build the application

/usr/bin/ld: ... XXXX.o):(.bss+0x10): multiple definition ofactivationsBaseAddress'; ... .o):(.bss+0x10): first defined here ...`

/usr/bin/ld: ... YYYY.o):(.bss+0x0): multiple definition ofconstWeightsBaseAddress'; ... .o):(.bss+0x0): first defined here ...`

/usr/bin/ld: ... ZZZZ.o):(.bss+0x8): multiple definition ofmutableWeightsBaseAddress'; ... .o):(.bss+0x8): first defined here ...`

.. and so on.

All .o file seems to export the same symbols. The linker is not happy.

I haven't found any documentation or example of trying to import more than one network. Maybe it's impossible?

Is there a way to around this issue?