Skip to content

Commit

Permalink
Merge pull request #1 from HenryLHH/feature/dev
Browse files Browse the repository at this point in the history
update package installation
  • Loading branch information
chenhongge authored Jan 14, 2025
2 parents 25c5689 + d22c2b6 commit 82c9b80
Show file tree
Hide file tree
Showing 67 changed files with 38 additions and 43 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,32 @@ The core structure of this repo is as follows:

```shell
git clone https://github.com/cruise-automation/CCDiff.git
cd CCDiff
conda create -n ccdiff python=3.8

# install ccdiff
# Install third-party dependencies
cd CCDiff/third_party

# Install trajdata
git clone https://github.com/AIasd/trajdata.git
cd trajdata
pip install -r trajdata_requirements.txt
pip install -e .

# Install Pplan
cd ..
git clone https://github.com/NVlabs/spline-planner.git Pplan
cd Pplan
pip install -e .

# install customized version of tbsim
cd third_party/tbsim
# Install customized version of tbsim
cd ../tbsim
pip install -r requirements.txt
pip install -e .

# Install ccdiff
cd ../../
pip install -e .

```
#### Training and Evaluation

Expand Down
2 changes: 1 addition & 1 deletion ccdiff/examples/causal_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def causal_ranking(causal_graph, topK = 10):
if __name__ == '__main__':
# parse the initial layout relationships
import joblib
scene_idx = joblib.load("0_scene_idx.pkl")
scene_idx = joblib.load("data/0_scene_idx.pkl")
filepath = "data/gt_results/scene_edit_eval/matrix/"
topK = 10

Expand Down
3 changes: 2 additions & 1 deletion ccdiff/models/ccdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
from .scenetemporal import SceneTransformer
from .temporal import TemporalMapUnet
import tbsim.dynamics as dynamics
from tbsim.utils.guidance_loss import verify_guidance_config_list, verify_constraint_config, apply_constraints, DiffuserGuidance, PerturbationGuidance, PartialPerturbationGuidance
from tbsim.utils.guidance_loss import verify_guidance_config_list, verify_constraint_config, apply_constraints, DiffuserGuidance
from ccdiff.utils.guidance_loss import PerturbationGuidance, PartialPerturbationGuidance
from trajdata.utils.arr_utils import angle_wrap
from tbsim.utils.trajdata_utils import extract_data_batch_for_guidance

Expand Down
2 changes: 1 addition & 1 deletion scripts/run_eval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ step=5

python ccdiff/examples/scene_editor.py --results_root_dir debug/ --num_scenes_per_batch 1 \
--dataset_path /mnt/disks/sdb/nuscenes --env trajdata \
--policy_ckpt_dir "ccdiff_trained_models copy/train/run0/" \
--policy_ckpt_dir "ccdiff_trained_models/train/run0/" \
--policy_ckpt_key iter10_ep0_valLoss16.87.ckpt --eval_class CCDiff \
--editing_source 'config' 'heuristic' --registered_name 'trajdata_nusc_ccdiff' \
--render --part_control --controllable_agent ${controllable_agent} \
Expand Down
32 changes: 4 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,14 @@
name="ccdiff",
packages=[package for package in find_packages() if package.startswith("ccdiff")],
install_requires=[
"networkx==2.8.8"
"networkx==2.8.8",
"torch==1.13.1",
"torchvision==0.14.1",
],
eager_resources=["*"],
include_package_data=True,
python_requires=">=3.8",
version="0.0.1",
long_description=long_description,
long_description_content_type="text/markdown",
)

# setup(
# name="tbsim",
# packages=[package for package in find_packages() if package.startswith("tbsim")],
# install_requires=[
# # "l5kit==1.5.0",
# "numpy==1.23.4", # need to manually update numpy version to (1.21.4) due to conflict with l5kit's requirement
# "pytorch-lightning==1.8.3.post0",
# "wandb",
# "torch==1.11",
# "torchvision==0.12.0",
# "pyemd",
# "h5py",
# "imageio-ffmpeg",
# "casadi",
# "protobuf==3.20.1", # new version might cause error
# "einops==0.6.0",
# "torchtext", # weird pytorch-lightning dependency bug
# ],
# eager_resources=["*"],
# include_package_data=True,
# python_requires=">=3.8",
# version="0.0.1",
# long_description=long_description,
# long_description_content_type="text/markdown",
# )
)
3 changes: 3 additions & 0 deletions third_party/tbsim/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pip==24.0
l5kit==1.5.0
imageio==2.9.0
9 changes: 3 additions & 6 deletions third_party/tbsim/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,16 @@
name="tbsim",
packages=[package for package in find_packages() if package.startswith("tbsim")],
install_requires=[
# "l5kit==1.5.0",
"numpy==1.23.4", # need to manually update numpy version to (1.21.4) due to conflict with l5kit's requirement
"pytorch-lightning==1.8.3.post0",
"numpy==1.23.4", # need to manually update numpy version to (1.21.4) due to conflict with l5kit's requirement
"wandb",
"torch==1.11",
"torchvision==0.12.0",
"pyemd",
"h5py",
"imageio-ffmpeg",
"imageio-ffmpeg==0.4.9",
"casadi",
"protobuf==3.20.1", # new version might cause error
"einops==0.6.0",
"torchtext", # weird pytorch-lightning dependency bug
"torchtext==0.14.1", # weird pytorch-lightning dependency bug
],
eager_resources=["*"],
include_package_data=True,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
from tbsim.configs.registry import get_registered_experiment_config
from tbsim.utils.config_utils import get_experiment_config_from_file
from tbsim.policies.hardcoded import (
ReplayPolicy,
GTPolicy,
GTPolicyOpenLoop,
GTNaNPolicy,
)
from ccdiff.policies.hierarchical import (
CCDiffHybridPolicyControl
CCDiffHybridPolicyControl,
ReplayPolicy
)

from tbsim.configs.base import ExperimentConfig
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 82c9b80

Please sign in to comment.