Alibaba-Gemini-Lab / OpenCheetah

189 stars 48 forks source link

About datasets used by different networks #19

Open leeztt opened 2 years ago

leeztt commented 2 years ago

hello, datasets used by different networks in OpenCheetah/networks, Lenet use MINST,
datasets used by sqnet, CIFAR-10 or ImageNet? resnet50? thanks!

fionser commented 2 years ago

Yes.

You can check that very first codes in the main function to see the input size. For example this line But these .cpp files are auto generated by EzPC's compilers, so it may look very massy.

leeztt commented 2 years ago

Thanks! sqnet in EzPC can be used on CIFATR-10, can cheetah? if it is possible, I have some problems when i test sqnet on CIFAR-10 image

fionser commented 2 years ago

From the codes we can see that, the current Cheetah is basically a backend of SCI. As a result, we can use any *.cpp files that generated by the EzPC compiler.

For your CIFAR-10 demo, The error says "filter with all zero is not supported", which means one of your filter is all 0.

Note that, the sqnet_model_scale12.inp is trained on ImageNet, so it can not be used directly on a CIFAR-10 input since the input dimension is not match.

I recommend you to compile a network for CIFAR-10 using EzPC's compiler.

leeztt commented 2 years ago

yes,my sqnet_model_scale12.inp is generated using EzPC/Athos/Networks/SqueezeNetCIFAR10/, then i run bash scripts/run-server.sh cheetah sqnet. I need to modify anything else?

fionser commented 2 years ago

"sqnet_model_scale12.inp" is just a serialized weight for the network (for example trained sqnet on CIFAR-10) But you still need the sqnet computation graph (i.e., the *.cpp files in the networks folder). For example this line some how indicate that, this is a program to takes input from ImageNet (224x224x3)

You need to check how to generate the *.cpp from Tensorflow's Python code using zPC's compiler.

leeztt commented 2 years ago

Sorry, I don't understand what you mean. I need to change the size? For example modify this line (1,227,227,3)-->(1,32,32,3)?

fionser commented 2 years ago

It might better to have a look on EzPC compiler which transforms a Python TensorFlow scripts to a Cpp program that can be run by Cheetah

fionser commented 2 years ago

han

For the current cpp programs in the networks/ folder are all generated using EzPC compiler. There are all static graph targeting ImageNet dataset. As a result, we might need to re-run EzPC compiler to generate a new Cpp program if we need to run on different datasets.