Qengineering / Jetson-Nano-Ubuntu-20-image

Jetson Nano with Ubuntu 20.04 image
https://qengineering.eu/install-ubuntu-20.04-on-jetson-nano.html
BSD 3-Clause "New" or "Revised" License
702 stars 74 forks source link

Torch Mean gives wrong results on CPU #45

Open lstoex opened 1 year ago

lstoex commented 1 year ago

I notice that using the transforms provided by PyTorch for their pretrained models in a Jupyter Notebook (in VSCode), the results were wildly incorrect. I managed to pinpoint the issue on the normalization step. In fact, even just calculating the channel-wise mean of a tensor gives wrong results. Surprisingly, the results are correct (that is, they match their Numpy counterpart) if the tensor is moved to the GPU first or if not Jupyter is involved.

Has anyone notice similar behavior ?

My pip list:

Details

Package Version absl-py 0.13.0 annotated-types 0.5.0 anyio 3.7.1 appdirs 1.4.4 apturl 0.5.2 argon2-cffi 23.1.0 argon2-cffi-bindings 21.2.0 arrow 1.2.3 asttokens 2.2.1 astunparse 1.6.3 async-lru 2.0.4 atomicwrites 1.1.5 attrs 23.1.0 Babel 2.12.1 backcall 0.2.0 backoff 2.2.1 bcrypt 3.1.7 beautifulsoup4 4.12.2 bleach 6.0.0 blessed 1.20.0 blinker 1.4 Brlapi 0.7.0 cachetools 4.2.2 certifi 2023.7.22 cffi 1.15.1 chardet 3.0.4 charset-normalizer 3.2.0 Click 7.0 colorama 0.4.3 comm 0.1.4 command-not-found 0.3 croniter 1.4.1 cryptography 2.8 cupshelpers 1.0 cycler 0.10.0 Cython 0.29.21 dateutils 0.6.12 dbus-python 1.2.16 debugpy 1.6.7.post1 decorator 5.1.1 deepdiff 6.3.1 defer 1.0.6 defusedxml 0.7.1 distro 1.4.0 distro-info 0.23ubuntu1 duplicity 0.8.12.0 entrypoints 0.3 et-xmlfile 1.0.1 exceptiongroup 1.1.3 executing 1.2.0 fastapi 0.101.1 fasteners 0.14.1 fastjsonschema 2.18.0 filelock 3.12.2 flatbuffers 1.12 fqdn 1.5.1 fsspec 2023.6.0 future 0.18.2 gast 0.3.3 gdown 3.13.1 google-auth 1.35.0 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 gps 3.20 grpcio 1.32.0 h11 0.14.0 h5py 2.10.0 html5lib 1.0.1 httplib2 0.14.0 idna 3.4 imageio 2.31.1 importlib-metadata 6.8.0 importlib-resources 6.0.1 inquirer 3.1.3 ipykernel 6.25.1 ipython 8.12.2 ipython-genutils 0.2.0 ipywidgets 8.1.0 isoduration 20.11.0 itsdangerous 2.1.2 jdcal 1.0 jedi 0.19.0 Jetson.GPIO 2.0.17 jetson-stats 4.2.1 Jinja2 3.1.2 json5 0.9.14 jsonpointer 2.4 jsonschema 4.19.0 jsonschema-specifications 2023.7.1 jupyter 1.0.0 jupyter_client 8.3.0 jupyter-console 6.6.3 jupyter_core 5.3.1 jupyter-events 0.7.0 jupyter-lsp 2.2.0 jupyter_server 2.7.2 jupyter_server_terminals 0.4.4 jupyterlab 4.0.5 jupyterlab-pygments 0.2.2 jupyterlab_server 2.24.0 jupyterlab-widgets 3.0.8 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.2 keyring 18.0.1 kiwisolver 1.0.1 language-selector 0.1 launchpadlib 1.10.13 lazr.restfulclient 0.14.2 lazr.uri 1.0.3 lazy_loader 0.3 lightning 2.0.7 lightning-cloud 0.5.37 lightning-utilities 0.9.0 lockfile 0.12.2 louis 3.12.0 lxml 4.5.0 macaroonbakery 1.3.1 Mako 1.2.4 Markdown 3.3.4 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.1.2 matplotlib-inline 0.1.6 mdurl 0.1.2 mistune 3.0.1 monotonic 1.5 more-itertools 4.2.0 mpmath 1.3.0 nbclient 0.8.0 nbconvert 7.7.4 nbformat 5.9.2 nest-asyncio 1.5.7 netifaces 0.10.4 networkx 3.1 notebook 7.0.2 notebook_shim 0.2.3 numpy 1.24.4 oauthlib 3.1.0 olefile 0.46 onboard 1.4.1 onnx 1.14.0 onnxruntime-gpu 1.11.0 openpyxl 3.0.3 opt-einsum 3.3.0 ordered-set 4.1.0 overrides 7.4.0 packaging 23.1 pandas 0.25.3 pandocfilters 1.5.0 paramiko 2.6.0 parso 0.8.3 pbr 5.6.0 pexpect 4.8.0 pickleshare 0.7.5 Pillow 10.0.0 pip 23.2.1 pkgutil_resolve_name 1.3.10 platformdirs 3.10.0 pluggy 0.13.0 prometheus-client 0.17.1 prompt-toolkit 3.0.39 protobuf 4.24.1 psutil 5.9.5 ptyprocess 0.7.0 pure-eval 0.2.2 py 1.8.1 pyasn1 0.4.8 pyasn1-modules 0.2.8 pybind11 2.7.1 pycairo 1.16.2 pycparser 2.21 pycuda 2022.2.2 pycups 1.9.73 pydantic 2.1.1 pydantic_core 2.4.0 Pygments 2.16.1 PyGObject 3.36.0 PyJWT 1.7.1 pymacaroons 0.13.0 PyNaCl 1.3.0 pyparsing 2.4.6 pyRFC3339 1.1 pyserial 3.4 PySocks 1.7.1 pytest 4.6.9 python-apt 2.0.1+ubuntu0.20.4.1 python-dateutil 2.8.2 python-debian 0.1.36+ubuntu1.1 python-dotenv 1.0.0 python-editor 1.0.4 python-json-logger 2.0.7 python-multipart 0.0.6 pytools 2023.1.1 pytorch-lightning 2.0.7 pytz 2023.3 PyWavelets 1.4.1 pyxattr 0.6.1 pyxdg 0.26 PyYAML 6.0.1 pyzmq 25.1.1 qtconsole 5.4.3 QtPy 2.3.1 readchar 4.0.5 referencing 0.30.2 reportlab 3.5.34 requests 2.31.0 requests-oauthlib 1.3.0 requests-unixsocket 0.2.0 rfc3339-validator 0.1.4 rfc3986-validator 0.1.1 rich 13.5.2 rpds-py 0.9.2 rsa 4.7.2 scikit-image 0.21.0 scipy 1.10.1 SecretStorage 2.3.1 Send2Trash 1.8.2 setuptools 58.0.4 simplejson 3.16.0 sip 4.19.21 six 1.16.0 smbus2 0.4.2 sniffio 1.3.0 soupsieve 2.4.1 ssh-import-id 5.10 stack-data 0.6.2 starlette 0.27.0 starsessions 1.3.0 sympy 1.12 system-service 0.3 systemd-python 234 tensorboard 2.6.0 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.0 tensorflow-estimator 2.4.0 tensorrt 8.0.1.6 termcolor 1.1.0 terminado 0.17.1 testresources 2.0.1 tifffile 2023.7.10 tinycss2 1.2.1 tomli 2.0.1 torch 1.13.0a0+git7c98e70 torchmetrics 1.1.0 torchvision 0.14.0a0+5ce4506 tornado 6.3.3 tqdm 4.62.3 traitlets 5.9.0 typing_extensions 4.7.1 ubuntu-advantage-tools 8001 ubuntu-drivers-common 0.0.0 ufw 0.36 uri-template 1.3.0 urllib3 2.0.4 urwid 2.0.1 uvicorn 0.23.2 wadllib 1.3.3 wcwidth 0.2.6 webcolors 1.13 webencodings 0.5.1 websocket-client 1.6.2 websockets 11.0.3 Werkzeug 2.0.1 wheel 0.34.2 widgetsnbextension 4.0.8 wrapt 1.12.1 xkit 0.0.0 xlrd 1.1.0 xlwt 1.3.0 youtube-dl 2020.3.24 zipp 3.16.2