snowzach / doods2

API for detecting objects in images and video streams using Tensorflow
MIT License
221 stars 28 forks source link

amd64 image is huge - 5.17GB #90

Closed rgogada closed 1 year ago

rgogada commented 1 year ago

I am using intel nuc12 with out any discrete graphics card. And I am using amd64 image. I use only pytorch. so wondering if the below is really necessary.

/usr/local/lib/python3.8/dist-packages/nvidia - 2.6GB and a few others.

DOODS1 image is only a few hundred MB and gives similar performance (ball park).

It is intentional?

snowzach commented 1 year ago

So DOODS1 is written in Go and uses the C tensorflow library. DOODS2 is python and comes with all the Goodies. The pytorch library sucks in support for nvidia.. Going to try to rebuild it now without that support. Hopefully will cut the size. It's really all the dependencies that take up the ridiculous amount of space.

rgogada commented 1 year ago

didn't even boot :) will look into it later

snowzach commented 1 year ago

Okay, just pushed a new image... Have a look..

rgogada commented 1 year ago

ok, it works now. the decompressed image size is now 2.92GB. better than earlier but still huge. let me dig further and see what I find.

Really appreciate your time and efforts on this project. Thanks.

snowzach commented 1 year ago

I don't think we're going to get it much smaller than that... The tensorflow and pytorch python libraries are just under 800MB each. 2.6 of the 2.9 gig is the python libraries directory.. Unfortunately pretty much everything in there is needed... Of the worst offenders, everything is required:

root@4b6c4a050484:/usr/local/lib/python3.8/dist-packages# du --max-depth=1 | sort -rn                                                                                                                                                                                                                                                                        2659204 .
763172  ./tensorflow
730124  ./torch
163680  ./tensorflow_io
92672   ./pydantic
91180   ./opencv_python.libs
87540   ./scipy
77740   ./cv2
73592   ./torchvision
67820   ./sympy
63340   ./pandas
46624   ./django
36864   ./clang
34928   ./scipy.libs
33388   ./numpy.libs
30212   ./numpy
29540   ./matplotlib
14792   ./tensorboard_data_server
13168   ./networkx
13096   ./tensorboard
12620   ./keras
12512   ./tensorflow_io_gcs_filesystem
11212   ./pip
rgogada commented 1 year ago

ok, that makes sense. thanks.