File size: 1,633 Bytes
e479c46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# bash run_evaluations.bash PORT_NUMBER

# Create logs directory if it doesn't exist
mkdir -p logs


LOG_FILE="logs/evaluation_results-${1}.log"

# Clear the log file
> $LOG_FILE

# List of environments to evaluate
# envs=(
#     "widowx_spoon_on_towel"
#     "widowx_carrot_on_plate"
#     "widowx_put_eggplant_in_basket"
#     "widowx_put_eggplant_in_sink"
#     "widowx_stack_cube"
#     "widowx_close_drawer"
#     "widowx_open_drawer"
# )

envs=(
    "google_robot_pick_coke_can"
    "google_robot_pick_object"
    "google_robot_move_near"
    "google_robot_open_drawer"
    "google_robot_close_drawer"
    "google_robot_place_in_closed_drawer"
)


echo "Starting evaluations..." | tee -a $LOG_FILE
echo "=================================" | tee -a $LOG_FILE

for env in "${envs[@]}"; do
    echo "Running evaluation for: $env" | tee -a $LOG_FILE
    echo "---------------------------------" | tee -a $LOG_FILE
    
    # Run the evaluation and capture output
    output=$(python eval_simpler.py --env "$env" --groot_port $1 --eval_count 350 --headless --episode_length 300 2>&1)
    exit_code=$?

    # Get the last 2 lines of output
    last_lines=$(echo "$output" | tail -n 2)

    # Log the results
    echo "Environment: $env" >> $LOG_FILE
    echo "$last_lines" >> $LOG_FILE
    echo "Exit code: $exit_code" >> $LOG_FILE
    echo "---------------------------------" >> $LOG_FILE
    echo "" >> $LOG_FILE
    
    # Print to console as well
    echo "Last 2 lines for $env:"
    echo "$last_lines"
    echo "Exit code: $exit_code"
    echo ""
done

echo "All evaluations completed. Results saved to $LOG_FILE"