Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: cannot convert float NaN to integer #80

Closed
ncusspm25 opened this issue Jun 5, 2022 · 5 comments
Closed

ValueError: cannot convert float NaN to integer #80

ncusspm25 opened this issue Jun 5, 2022 · 5 comments
Assignees

Comments

@ncusspm25
Copy link

Hi,

I am a college student studying point cloud. I want to label my own point cloud data.
But I encounter problems when loading the file. Attached is my file and the error message.
I also refer to your solution from other's same problem but it's not work.
https://github.com/ch-sa/labelCloud/tree/ch-sa/nan-pcd

image
image

Hope you can give me advice. Thank you very much!

Sincerely,
Yuan

@ch-sa
Copy link
Owner

ch-sa commented Jun 8, 2022

Hi @ncusspm25,

will have a look at the point cloud later.

Until then could you please check if you can open it with the Open3D viewer?

Also could you provide me the following infos:

  • installed python packages pip list
  • python version
  • platform

Best,

Christoph

@ncusspm25
Copy link
Author

ncusspm25 commented Jun 8, 2022

Hi @ch-sa ,

thank for your reply.

I can open my pcd file with the Open3D viewer

  1. pip list

absl-py 1.0.0
aiodns 3.0.0
aiohttp 3.8.1
aiohttp-cors 0.7.0
aioredis 1.3.1
aiosignal 1.2.0
alabaster 0.7.8
albumentations 1.1.0
ale-py 0.7.5
alpaca-trade-api 2.1.0
appdirs 1.4.4
apptools 5.1.0
apturl 0.5.2
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
asn1crypto 0.24.0
astor 0.8.1
astunparse 1.6.3
async-timeout 4.0.2
asynctest 0.13.0
atari-py 0.2.6
attrs 19.3.0
AutoROM 0.4.2
AutoROM.accept-rom-license 0.4.2
Babel 2.4.0
backcall 0.2.0
beautifulsoup4 4.8.2
bleach 4.1.0
blessed 1.19.1
blinker 1.4
box2d-py 2.3.8
Brlapi 0.6.6
cached-property 1.5.2
cachetools 4.0.0
catkin-pkg-modules 0.4.24
ccimport 0.3.7
ccxt 1.72.98
certifi 2019.11.28
cffi 1.15.0
cfgv 3.3.1
chardet 3.0.4
charset-normalizer 2.0.12
checkbox-support 0.22
Click 7.0
cloudpickle 1.3.0
cnn-finetune 0.6.0
colorama 0.4.3
colorful 0.5.4
command-not-found 0.3
configobj 5.0.6
cryptography 36.0.2
cumm-cu113 0.2.8
cupshelpers 1.0
cycler 0.10.0
Cython 0.29.22
debugpy 1.5.1
decorator 4.4.2
defer 1.0.6
defusedxml 0.7.1
Deprecated 1.2.13
deprecation 2.1.0
distlib 0.3.4
distro-info 0.18ubuntu0.18.04.1
dm-tree 0.1.5
docutils 0.14
easydict 1.9
efficientnet-pytorch 0.7.1
elegantrl 0.3.3
emd 0.5.3
empy 3.3.2
empyrical 0.5.5
entrypoints 0.4
envisage 6.0.1
exchange-calendars 3.6.1
fasteners 0.17.3
feedparser 5.2.1
filelock 3.6.0
finrl 0.3.5
fire 0.4.0
flake8 3.5.0
flatbuffers 1.12
fonttools 4.31.2
frozenlist 1.3.0
funcsigs 1.0.2
future 0.18.2
gast 0.3.3
geomloss 0.2.1
glfw 2.5.3
google 2.0.3
google-api-core 2.7.1
google-auth 1.11.2
google-auth-oauthlib 0.4.1
google-pasta 0.1.8
googleapis-common-protos 1.56.0
gpustat 1.0.0b1
GPUtil 1.4.0
greenlet 1.1.2
grpcio 1.27.2
guacamole 0.9.2
gym 0.21.0
gym-continuousDoubleAuction 0.0.1
h5py 2.10.0
hiredis 2.0.0
html5lib 0.999999999
httplib2 0.9.2
identify 2.4.12
idna 2.9
ifcfg 0.18
imageio 2.4.1
imageio-ffmpeg 0.4.5
imagesize 0.7.1
imgaug 0.4.0
importlib-metadata 4.11.3
importlib-resources 5.4.0
install 1.3.5
ipyevents 2.0.1
ipykernel 6.9.2
ipython 7.32.0
ipython-genutils 0.2.0
ipywidgets 7.7.0
jedi 0.18.1
Jinja2 2.10
joblib 0.14.1
jqdatasdk 1.8.10
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 7.1.2
jupyter-console 6.4.3
jupyter-core 4.9.2
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.1.0
keras 2.7.0
Keras-Applications 1.0.8
keras-nightly 2.10.0.dev2022041107
Keras-Preprocessing 1.1.2
keras-rl 0.4.2
keyring 10.6.0
keyrings.alt 3.0
kiwisolver 1.2.0
KNN-CUDA 0.2
korean-lunar-calendar 0.2.1
labelCloud 0.7.7
language-selector 0.1
lark 1.1.2
lark-parser 0.7.2
launchpadlib 1.10.6
lazr.restfulclient 0.13.5
lazr.uri 1.0.3
libclang 13.0.0
llvmlite 0.38.0
louis 3.5.0
lxml 4.8.0
lz4 3.0.2
macaroonbakery 1.1.3
Mako 1.0.7
Markdown 3.2.1
MarkupSafe 1.0
matplotlib 3.3.3
matplotlib-inline 0.1.3
mayavi 4.7.4
mccabe 0.6.1
mistune 0.8.4
mock 4.0.3
more-itertools 8.2.0
msgpack 1.0.3
mujoco-py 2.1.2.14
multidict 4.7.5
multitasking 0.0.10
munch 2.5.0
nbclient 0.5.13
nbconvert 6.4.4
nbformat 5.2.0
nest-asyncio 1.5.4
netifaces 0.10.4
networkx 2.6.3
ninja 1.10.2.3
nodeenv 1.6.0
nose 1.3.7
notebook 6.4.11
numba 0.55.1
numpy 1.21.6
nvidia-ml-py3 7.352.0
oauth 1.0.1
oauthlib 3.1.0
olefile 0.45.1
open3d 0.9.0.0
open3d-python 0.7.0.0
opencensus 0.8.0
opencensus-context 0.1.2
opencv-contrib-python 4.5.5.64
opencv-python 4.2.0.34
opencv-python-headless 4.5.2.52
opt-einsum 3.1.0
packaging 20.1
padme 1.1.1
pandas 1.3.5
pandas-datareader 0.10.0
pandas-ta 0.3.14b0
pandocfilters 1.4.2
parso 0.8.3
pbr 5.8.1
pccm 0.3.4
pexpect 4.8.0
pickleshare 0.7.5
Pillow 7.0.0
pip 22.1.1
pip-autoremove 0.10.0
plac 1.1.3
plainbox 0.25
platformdirs 2.5.1
plotly 5.7.0
pluggy 0.13.1
ply 3.11
portalocker 2.4.0
pre-commit 2.17.0
pretrainedmodels 0.7.4
progress 1.6
prometheus-client 0.7.1
prompt-toolkit 3.0.28
protobuf 3.20.1
psutil 5.9.0
psycopg2-binary 2.9.3
ptyprocess 0.6.0
py 1.8.1
py-spy 0.3.3
pyasn1 0.4.8
pyasn1-modules 0.2.8
pybind11 2.6.2
pybullet 3.2.1
pycairo 1.16.2
pycares 4.1.2
pycodestyle 2.3.1
pycosat 0.6.3
pycparser 2.21
pycrypto 2.6.1
pycups 1.9.73
pycurl 7.43.0.1
pydocstyle 2.0.0
pydot 1.2.3
pyface 7.4.1
pyflakes 1.6.0
pyfolio 0.9.2+75.g4b901f6
pyglet 1.5.0
Pygments 2.11.2
PyGObject 3.26.1
pyinotify 0.9.6
PyJWT 1.5.3
pyluach 1.4.0
pymacaroons 0.13.0
PyMySQL 1.0.2
PyNaCl 1.1.2
pyopencl 2021.1.2
PyOpenGL 3.1.6
pyOpenSSL 17.5.0
pyparsing 2.4.6
pypcd 0.1.1
PyQt5 5.15.6
PyQt5-Qt5 5.15.2
PyQt5-sip 12.10.1
pyRFC3339 1.0
pyrsistent 0.15.7
pytest 5.3.5
python-apt 1.6.5+ubuntu0.7
python-dateutil 2.8.1
python-debian 0.1.32
python-lzf 0.2.4
pytools 2021.1.2
pytz 2019.3
PyWavelets 1.3.0
pyxdg 0.25
PyYAML 6.0
pyzmq 22.3.0
qtconsole 5.3.0
QtPy 2.0.1
qudida 0.0.4
ray 0.8.5
redis 3.4.1
reportlab 3.4.0
requests 2.23.0
requests-oauthlib 1.3.0
requests-unixsocket 0.1.5
roman 2.0.0
rosdistro-modules 0.8.3
rospkg-modules 1.4.0
rsa 4.0
rtrl 0.1
ruamel.yaml 0.17.21
ruamel.yaml.clib 0.2.6
runipy 0.1.5
scapy 2.4.5
scikit-image 0.19.2
scikit-learn 0.22.2
scipy 1.4.1
screen-resolution-extra 0.0.0
seaborn 0.11.2
SecretStorage 2.3.1
Send2Trash 1.8.0
setuptools 59.5.0
Shapely 1.8.1.post1
simplejson 3.13.2
six 1.14.0
sklearn 0.0
smart-open 5.2.1
snowballstemmer 1.2.1
sortedcontainers 2.1.0
soupsieve 2.0
sparse 0.13.0
spconv 2.1.21
spconv-cu113 2.1.21
Sphinx 1.6.7
sphinx-rtd-theme 0.2.4
SQLAlchemy 1.4.32
ssh-import-id 5.7
stable-baselines 2.10.2
stevedore 3.5.0
stochastic 0.6.0
stockstats 0.4.1
system-service 0.3
systemd-python 234
ta 0.9.0
tabulate 0.8.6
tb-nightly 2.9.0a20220502
tenacity 8.0.1
tensorboard 2.2.1
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.6.0.post3
tensorboardX 2.0
tensorflow-estimator 2.7.0
tensorflow-gpu 1.15.4
tensorflow-io 0.25.0
tensorflow-io-gcs-filesystem 0.25.0
tensorflow-serving-api 1.15.0
tensortrade 1.0.4.dev1
termcolor 1.1.0
terminado 0.13.3
testpath 0.4.4
tf-estimator-nightly 2.10.0.dev2022050208
tf-nightly 2.10.0.dev20220427
tgym 0.1.13
threadpoolctl 3.1.0
thriftpy2 0.4.14
tifffile 2021.11.2
toml 0.10.2
toolz 0.11.2
torch 1.5.0
torchsummary 1.5.1
torchvision 0.6.0
tornado 6.1
tqdm 4.54.0
traitlets 5.1.1
traits 6.3.2
traitsui 7.3.1
transforms3d 0.3.1
typed-ast 1.4.1
typing_extensions 4.1.1
ubuntu-advantage-tools 27.7
ubuntu-drivers-common 0.0.0
ufw 0.36
unattended-upgrades 0.1
unity-scope-calculator 0.1
unity-scope-chromiumbookmarks 0.1
unity-scope-colourlovers 0.1
unity-scope-devhelp 0.1
unity-scope-firefoxbookmarks 0.1
unity-scope-manpages 0.1
unity-scope-openclipart 0.1
unity-scope-texdoc 0.1
unity-scope-tomboy 0.1
unity-scope-virtualbox 0.1
unity-scope-yelp 0.1
unity-scope-zotero 0.1
urllib3 1.25.8
usb-creator 0.3.3
virtualenv 20.13.4
virtualenv-clone 0.5.7
virtualenvwrapper 4.8.4
vtk 9.1.0
wadllib 1.3.2
wcwidth 0.1.8
webencodings 0.5.1
websocket-client 1.3.1
websockets 9.1
Werkzeug 2.1.2
wget 3.2
wheel 0.37.1
widgetsnbextension 3.6.0
wrapt 1.11.2
wrds 3.1.1
wslink 1.5.3
xdiagnose 3.8.8
xkit 0.0.0
xlrd 2.0.1
XlsxWriter 0.9.6
xmltodict 0.12.0
xvfbwrapper 0.2.9
yacs 0.1.8
yarl 1.4.2
yfinance 0.1.64
zipp 3.8.0
zope.interface 4.3.2

  1. python version
    Python 3.7.13

  2. platform
    Linux

Sincerely,
Yuan

@ch-sa
Copy link
Owner

ch-sa commented Jun 14, 2022

Hello @ncusspm25,

I just noticed that you only provided a screenshot of the point cloud. Could you upload the .pcd file so I can replicate the issue?

Your setup looks fine, maybe you could update Open3D.

You could try opening the point cloud without colorizing it by setting colorless_colorize = False in the config.ini as the error seems to be raised there (although I suspect an issue on loading).

I can probably give more specific feedback if you provide the point cloud.

Best,

Christoph

@ncusspm25
Copy link
Author

Hi @ch-sa

I upload my pcd file on Google Drive.
https://drive.google.com/drive/folders/1PfA_0wKZNc1vSquVrv6Enug2xNXVJ618?usp=sharing

I follow your advice to change the config.ini and it works. Thanks a million!

I want to use these pcd to build 2D-lidar object detection system. Before that I want to build my own dataset like KITTI dataset.

Sincerely,

Yuan

ch-sa added a commit that referenced this issue Jun 16, 2022
 - add warning when loading *.pcd point clouds

Relates: #68 #80
@ch-sa
Copy link
Owner

ch-sa commented Jun 16, 2022

Hi @ncusspm25,

thanks a lot for providing the point cloud. I could replicate the behavior.

It is closely related to issue: #68. There is a bug when using Open3D to load a *.pcd inside a PyQt application (on Linux):
isl-org/Open3D#4969

This leads to point coordinates being rounded, which in your case led to all points having the same z-value of 0.
This crashed the colorization function as there is now no relative height distance anymore ... and you can't divide by 0. ;)

  1. I catch this case now and don't colorize in this situation.
  2. I raise a warning (in the terminal) when loading a *.pcd point cloud.

Unfortunately it does not seem that this issue is addressed upstream (i.e. in Open3D). You could comment in the linked issue that it also affects you, if you would like to.

One workaround is to convert your point clouds into a different format (*.ply) for example before loading, like I explained here:
#68 (comment)

As this seems to affect quite a lot of people I might have to replace Open3D with a different loader in future ...

Hope this helps,

Christoph

EDIT
After converting to *.ply it works:
image

You can convert with the following

# Convert all *.pcd to *.ply
import os

import open3d as o3d
pcd_folder = "nan-pcd"

for pcd_name in os.listdir(pcd_folder):
    o3d.io.write_point_cloud(f"{pcd_name[:-4]}.ply", o3d.io.read_point_cloud(f"{pcd_folder}/{pcd_name}"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants