Skip to content

Commit

Permalink
trying to fix gpu thing
Browse files Browse the repository at this point in the history
  • Loading branch information
luisa-mao committed May 29, 2024
1 parent 41892f7 commit 4aaa614
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions config/navigation_jackal_icl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ end

NavigationParameters = {
laser_topic = "velodyne_2dscan_highbeams";
odom_topic = "/odom";
-- odom_topic = "/odometry/filtered";
odom_topic = "/odometry/filtered";
localization_topic = "localization";
image_topic = "/bev/single/compressed";
init_topic = "initialpose";
Expand Down Expand Up @@ -61,7 +60,7 @@ TerrainEvaluator = {
-- discount_factor = 0.8; -- ahg demo
rollout_density = 10;

model_path = "/home/dev/graph_navigation/terrain_models/model.pt";
model_path = "../terrain_models/model.pt";

-- dist_to_goal_weight = -0.2;
-- dist_to_goal_weight = -0.7;
Expand Down
7 changes: 3 additions & 4 deletions src/navigation/terrain_evaluator2.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class CustomTerrainEvaluator : public TerrainEvaluator {
torch::Tensor context_tensor_;
CustomTerrainEvaluator() : TerrainEvaluator() {
// todo: store the context as private variable
torch::jit::script::Module tensors = torch::jit::load("terrain_models/context.pt");
torch::jit::script::Module tensors = torch::jit::load("../terrain_models/context.pt");
context_tensor_ = tensors.run_method("return_tensor").toTensor();
}

Expand Down Expand Up @@ -87,11 +87,10 @@ class CustomTerrainEvaluator : public TerrainEvaluator {
torch::NoGradGuard no_grad;

// Run the model with the inputs
auto output = cost_model_.forward(inputs).toTensor().to(torch::kCPU);
// auto output = cost_model_.run_method("forward_w_encoded_patches", inputs).toTensor();
auto output = cost_model_.forward(inputs).toTensor();

// apply sigmoid to the output
output = torch::sigmoid(output);
output = torch::sigmoid(output).to(torch::kCPU);


// Print the shape of the output
Expand Down

0 comments on commit 4aaa614

Please sign in to comment.