Skip to content

Commit

Permalink
partial changes with model delpoyment
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeriobonatti committed Jun 14, 2022
1 parent 5a049f7 commit 1933988
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
3 changes: 2 additions & 1 deletion mushr_rhc_ros/launch/real/real_model_deploy_new.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
<arg name="n_layers" default="12" />

<!-- action model -->
<!-- <arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/6m_scratch/GPTcorl_6m_pre_trainm_e2e_statet_pointnet_traini_1_nla_12_nhe_8_statel_0.1_weightdecay_0.0001_weightdecayb_0.1_lr_6e-4_2022-06-13_1655139613.6754146_2022-06-13_1655139613.6754277/model/epoch10.pth.tar" /> -->
<arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/model_sizes_3/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_1_nla_12_nhe_8_statel_0.1_weightdecay_0.0001_weightdecayb_0.1_lr_6e-4_2022-06-10_1654843603.5495381_2022-06-10_1654843603.5495553/model/epoch30.pth.tar" />
<!-- <arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/model_sizes_0/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_0_nla_6_nhe_8_statel_0.01_2022-06-03_1654253046.3212142_2022-06-03_1654253046.3212266/model/epoch30.pth.tar" /> -->
<!-- <arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/model_sizes_0/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_1_nla_24_nhe_8_statel_0.01_2022-06-03_1654235683.085602_2022-06-03_1654235683.0856125/model/epoch30.pth.tar" /> -->

<!-- map model -->
<arg name="use_map" default="true" />
<arg name="use_map" default="false" />
<!-- without fine-tuning, 100% of data -->
<arg name="model_path_map" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/finetune_episodes_map_4/GPTcorl_map_trainm_map_sta_pointnet_traini_1_nla_12_nhe_8_fre_False_2022-06-11_1654906825.070987_2022-06-11_1654906825.0709982/model/epoch20.pth.tar" />

Expand Down
5 changes: 4 additions & 1 deletion mushr_rhc_ros/launch/sim/sim_server_eval.launch
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<arg name="n_layers" default="12" />

<!-- action model -->
<arg name="model_path_act" type="str" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/model_sizes_3/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_1_nla_12_nhe_8_statel_0.1_weightdecay_0.0001_weightdecayb_0.1_lr_6e-4_2022-06-10_1654843603.5495381_2022-06-10_1654843603.5495553/model/epoch31.pth.tar" />
<arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/6m_scratch/GPTcorl_6m_pre_trainm_e2e_statet_pointnet_traini_1_nla_12_nhe_8_statel_0.1_weightdecay_0.0001_weightdecayb_0.1_lr_6e-4_2022-06-13_1655139613.6754146_2022-06-13_1655139613.6754277/model/epoch10.pth.tar" />
<!-- <arg name="model_path_act" type="str" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/model_sizes_3/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_1_nla_12_nhe_8_statel_0.1_weightdecay_0.0001_weightdecayb_0.1_lr_6e-4_2022-06-10_1654843603.5495381_2022-06-10_1654843603.5495553/model/epoch31.pth.tar" /> -->

<!-- <arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/hvd_test_16/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_1_nla_12_nhe_8_statel_0.01_2022-06-02_1654131996.2524076_2022-06-02_1654131996.2524228/model/epoch30.pth.tar" /> -->
<!-- <arg name="model_path_act" default="/home/rb/hackathon_data_premium/aml_outputs/log_output/model_sizes_0/GPTcorl_scratch_trainm_e2e_statet_pointnet_traini_0_nla_6_nhe_8_statel_0.01_2022-06-03_1654253046.3212142_2022-06-03_1654253046.3212266/model/epoch30.pth.tar" /> -->
Expand Down Expand Up @@ -61,6 +62,8 @@

<param name="car_name" value="$(arg car_name)" />

<param name="is_real_deployment" value="false" />

<rosparam file="$(find mushr_rhc_ros)/launch/params/trajgen/$(arg tg).yaml" />
<rosparam file="$(find mushr_rhc_ros)/launch/params/all_params.yaml" />
<rosparam file="$(find mushr_rhc_ros)/launch/sim/params.yaml" />
Expand Down
3 changes: 1 addition & 2 deletions mushr_rhc_ros/src/mingpt/model_resnetdirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

import sys
sys.path.append('../')
from models.compass.select_backbone import select_resnet

# from models.compass.select_backbone import select_resnet

class ResnetDirect(nn.Module):
""" the full GPT language model, with a context size of block_size """
Expand Down
3 changes: 2 additions & 1 deletion mushr_rhc_ros/src/preprocessing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ def denorm_angle(angle):
return (angle*(act_max-act_min)+act_max+act_min)/2

def load_params(data_col):
condition = (data_col[1:]<12.0) & (data_col[1:]>0.5) & (~np.isnan(data_col[1:]))
condition = (data_col[1:]<12.0) & (data_col[1:]>0.5) & (~np.isnan(data_col[1:])) # params for the dataset collection
# condition = (data_col[1:]<4.0) & (data_col[1:]>0.1) & (~np.isnan(data_col[1:]))
ok_R = np.extract(condition, data_col[1:])
num_points = ok_R.shape[0]
# angles = np.linspace(0, 2*np.pi, 720)*-1.0 + np.pi # aligned in car coordinate frame (because ydlidar points backwards)
Expand Down
7 changes: 7 additions & 0 deletions mushr_rhc_ros/src/rhcnode_network_pcl_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import preprocessing_utils as pre
from visualization_msgs.msg import Marker

import cv2

# import torch_tensorrt


Expand Down Expand Up @@ -695,6 +697,11 @@ def process_scan(self, msg):
scan[0] = msg.header.stamp.to_sec()
scan[1:] = msg.ranges
original_points, sensor_origins, time_stamps, pc_range, voxel_size, lo_occupied, lo_free = pre.load_params(scan)

vis_mat, nx, ny = pre.compute_bev_image(original_points, sensor_origins, time_stamps, pc_range, voxel_size)
cv2.imshow('graycsale image',vis_mat)
cv2.waitKey(1)

points_to_save = np.zeros(shape=(720,2))
points_to_save[:original_points.shape[0],:] = original_points[:,:2]
if original_points.shape[0]>0:
Expand Down

0 comments on commit 1933988

Please sign in to comment.