From 5fa5c1070f6e7e35e177a7516cb4785571b8b9b6 Mon Sep 17 00:00:00 2001 From: Quanyi Li Date: Wed, 4 Oct 2023 16:46:39 +0100 Subject: [PATCH] Loose numpy version (#30) * disable using pip extra requirement installation * loose numpy * waymo * waymo version * add numpy hint * restore * Add to note * add hint --- documentation/example.rst | 8 +++--- documentation/install.rst | 18 -------------- documentation/nuplan.rst | 3 --- documentation/nuscenes.rst | 3 --- documentation/waymo.rst | 5 ++-- scenarionet/converter/waymo/utils.py | 4 +-- setup.py | 37 ++++++++++++++-------------- 7 files changed, 27 insertions(+), 51 deletions(-) diff --git a/documentation/example.rst b/documentation/example.rst index 308b00a..3e1b968 100644 --- a/documentation/example.rst +++ b/documentation/example.rst @@ -13,13 +13,13 @@ For any dataset, this step is necessary after installing ScenarioNet, as we need to use the official toolkits of the data provider to parse the original scenario description and convert to our internal scenario description. For Waymo data, please install the toolkit via:: - pip install waymo-open-dataset-tf-2-11-0==1.5.0 - - # Or install with scenarionet - pip install -e .[waymo] + pip install waymo-open-dataset-tf-2-11-0 + pip install tensorflow==2.11.0 .. note:: This package is only supported on Linux platform. + `waymo-open-dataset` may degrade numpy, causing conflicts with cv2. + A workaround is ``pip install numpy==1.24.2`` For other datasets like nuPlan and nuScenes, you need to setup `nuplan-devkit `_ and `nuscenes-devkit `_ respectively. Guidance on how to setup these datasets and connect them with ScenarioNet can be found at :ref:`datasets`. diff --git a/documentation/install.rst b/documentation/install.rst index a92e571..d820df9 100644 --- a/documentation/install.rst +++ b/documentation/install.rst @@ -67,26 +67,8 @@ For ScenarioNet, we only provide Github installation:: git clone git@github.com:metadriverse/scenarionet.git cd scenarionet - -Anyone of the following commands will automatically install basic requirements with additional requirements -for specific datasets:: - - # Install basic requirement only pip install -e . - # Install Waymo official toolkit - pip install -e .[waymo] - - # Install nuScenes development tookit - pip install -e .[nuscenes] - - # Install nuPlan development tookit - pip install -e .[nuplan] - - # Install all toolkit for all datasets - pip install -e .[all] - - .. note:: If you don't wanna access the source code, you can install these two packages with ``pip install git+https://github.com/metadriverse/scenarionet.git`` diff --git a/documentation/nuplan.rst b/documentation/nuplan.rst index c4e8401..4ae91f4 100644 --- a/documentation/nuplan.rst +++ b/documentation/nuplan.rst @@ -30,9 +30,6 @@ First of all, we have to install the ``nuplan-devkit``. # 2. or install from PyPI pip install nuplan-devkit - # 3. or install with scenarionet - pip install -e .[nuplan] - By installing from github, you can access examples and source code the toolkit. The examples are useful to verify whether the installation and dataset setup is correct or not. diff --git a/documentation/nuscenes.rst b/documentation/nuscenes.rst index e455b8f..5671b10 100644 --- a/documentation/nuscenes.rst +++ b/documentation/nuscenes.rst @@ -34,9 +34,6 @@ First of all, we have to install the ``nuscenes-devkit``. # or install from PyPI pip install nuscenes-devkit - # or install with scenarionet - pip install -e .[nuscenes] - By installing from github, you can access examples and source code the toolkit. The examples are useful to verify whether the installation and dataset setup is correct or not. diff --git a/documentation/waymo.rst b/documentation/waymo.rst index 1891aa2..631d033 100644 --- a/documentation/waymo.rst +++ b/documentation/waymo.rst @@ -34,11 +34,10 @@ First of all, we have to install the waymo toolkit and tensorflow:: pip install waymo-open-dataset-tf-2-11-0 pip install tensorflow==2.11.0 - # Or install with scenarionet - pip install -e .[waymo] - .. note:: This package is only supported on Linux platform. + `waymo-open-dataset` may degrade numpy, causing conflicts with cv2. + A workaround is ``pip install numpy==1.24.2`` 2. Download TFRecord ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/scenarionet/converter/waymo/utils.py b/scenarionet/converter/waymo/utils.py index 7865f22..8d06ef5 100644 --- a/scenarionet/converter/waymo/utils.py +++ b/scenarionet/converter/waymo/utils.py @@ -21,7 +21,7 @@ except ImportError as e: try: from waymo_open_dataset.protos import scenario_pb2 except ImportError as e: - logger.warning(e, "\n Please install waymo_open_dataset package: pip install waymo-open-dataset-tf-2-11-0==1.5.0") + logger.warning(e, "\n Please install waymo_open_dataset package: pip install waymo-open-dataset-tf-2-11-0") from metadrive.scenario import ScenarioDescription as SD from metadrive.type import MetaDriveType @@ -469,7 +469,7 @@ def read_from_files(arg): try: scenario_pb2 except NameError: - raise ImportError("Please install waymo_open_dataset package: pip install waymo-open-dataset-tf-2-11-0==1.5.0") + raise ImportError("Please install waymo_open_dataset package: pip install waymo-open-dataset-tf-2-11-0") waymo_data_directory, file_list = arg[0], arg[1] scenarios = [] for file in tqdm.tqdm(file_list): diff --git a/setup.py b/setup.py index b893868..0ccf1e7 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ print("We will install the following packages: ", packages) version = "0.0.1" install_requires = [ - "numpy>=1.21.6, <=1.24.2", + "numpy>=1.21.6", "matplotlib", "pandas", "tqdm", @@ -55,19 +55,20 @@ train_requirement = [ "tensorflow", "tensorflow_probability"] -waymo = ["waymo-open-dataset-tf-2-11-0", "tensorflow==2.11.0"] - -nuplan = ["nuplan-devkit>=1.2.0", - "bokeh==2.4", - "hydra-core", - "chardet", - "pyarrow", - "aiofiles", - "retry", - "boto3", - "aioboto3"] - -nuscenes = ["nuscenes-devkit>=1.1.10"] +# Disable this kind of installation +# waymo = ["waymo-open-dataset-tf-2-11-0", "tensorflow==2.11.0"] +# +# nuplan = ["nuplan-devkit>=1.2.0", +# "bokeh==2.4", +# "hydra-core", +# "chardet", +# "pyarrow", +# "aiofiles", +# "retry", +# "boto3", +# "aioboto3"] +# +# nuscenes = ["nuscenes-devkit>=1.1.10"] setup( name="scenarionet", @@ -82,10 +83,10 @@ setup( extras_require={ "train": train_requirement, "doc": doc, - "waymo": waymo, - "nuplan": nuplan, - "nuscenes": nuscenes, - "all": nuscenes + waymo + nuplan + # "waymo": waymo, + # "nuplan": nuplan, + # "nuscenes": nuscenes, + # "all": nuscenes + waymo + nuplan }, include_package_data=True, license="Apache 2.0",