Skip to content

Commit

Permalink
Reverting changes specific to jeanzay
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliotMaitre committed Sep 14, 2023
1 parent 2d7e77a commit 15aad8e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: happypose2
name: happypose
channels:
- conda-forge
- pytorch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@

CNOS_SUBMISSION_PATHS = {ds_name: CNOS_SUBMISSION_DIR / fname for ds_name, fname in CNOS_SUBMISSION_FILES.items()}
# Check if all paths exist
print("cnos values =", CNOS_SUBMISSION_PATHS.values())
print("len cnos =", len(CNOS_SUBMISSION_FILES))
print("sum=", sum(p.exists() for p in CNOS_SUBMISSION_PATHS.values()))
assert( sum(p.exists() for p in CNOS_SUBMISSION_PATHS.values()) == len(CNOS_SUBMISSION_FILES))
##################################
##################################
Expand Down Expand Up @@ -284,25 +281,11 @@ def get_predictions(self, pose_estimator: PoseEstimator) -> Dict[str, PoseEstima
df_targets = pd.read_json(self.scene_ds.ds_dir / "test_targets_bop19.json")

for n, data in enumerate(tqdm(self.dataloader)):
print('\n\n\n\n################')
print(f'DATA FROM DATALOADER {self.scene_ds.ds_dir.name}', f'{n}/{len(self.dataloader)}')
print('data["im_infos"]:', data['im_infos'])
print('################')
# data is a dict
rgb = data["rgb"]
depth = data["depth"]
K = data["cameras"].K

# ############ RUN ONLY BEGINNING OF DATASET
# # if n > 0:
#if n < 220:
# # if n != 582:
# print('################')
# print('Prediction runner SKIP')
# print('################')
# continue
# ############ RUN ONLY BEGINNING OF DATASET

# Dirty but avoids creating error when running with real detector
dt_det = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def init_distributed_mode():
backend="nccl",
rank=rank,
world_size=world_size,
timeout=datetime.timedelta(seconds=1800 * 16),
timeout=datetime.timedelta(seconds=1800 * 4),
)
torch.distributed.barrier()

Expand Down
4 changes: 2 additions & 2 deletions happypose/toolbox/utils/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_tmp_dir() -> Path:
if "JOB_DIR" in os.environ:
tmp_dir = Path(os.environ["JOB_DIR"]) / "tmp"
else:
tmp_dir = Path("/gpfsscratch/rech/zja/udg82mu/happypose_datasets/results/tmp/megapose_job")
tmp_dir = Path("/tmp/megapose_job")
tmp_dir.parent.mkdir(exist_ok=True)
tmp_dir.mkdir(exist_ok=True)
return tmp_dir
Expand Down Expand Up @@ -149,6 +149,6 @@ def init_distributed_mode() -> None:
backend="nccl",
rank=rank,
world_size=world_size,
timeout=datetime.timedelta(seconds=16 * 1800), # 2 hours
timeout=datetime.timedelta(seconds=4 * 1800), # 2 hours
)
torch.distributed.barrier()
5 changes: 0 additions & 5 deletions happypose/toolbox/utils/tensor_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
# MegaPose
from happypose.toolbox.utils.distributed import get_rank, get_world_size

from happypose.pose_estimators.megapose.src.megapose.config import (
RESULTS_DIR,
)

def concatenate(datas):
datas = [data for data in datas if len(data) > 0]
if len(datas) == 0:
Expand Down Expand Up @@ -171,7 +167,6 @@ def gather_distributed(self, tmp_dir=None):

if rank > 0:
tmp_file = tmp_file_template.format(rank=rank)
print("tmp_file =", tmp_file)
torch.save(self, tmp_file)

if world_size > 1:
Expand Down

0 comments on commit 15aad8e

Please sign in to comment.