mw9385 / Collision-avoidance

Towards Monocular Vision Based Collision Avoidance Using Deep Reinforcement Learning
35 stars 8 forks source link

Agent model error #8

Open Jaumegopu opened 7 months ago

Jaumegopu commented 7 months ago

When I try to run the code I get the following error among other things: Node: 'AssignVariableOp' Trying to assign to variable with tensor with wrong shape. Expected [10,14,8,32] got [32,6,8,8] [[{{node AssignVariableOp}}]] I am starting with coding and I am not familiar with all the information I got displayed. It may help also to know that before that error I also get: "GPU will not be used" and "Could not find TensorRT". If I did not provide enough information, I would appreciate an explanation on what's the error about instead. Thanks in advance

mw9385 commented 7 months ago

Hi, can explain more detail? What is your setting for the model and how you implement the code?

Jaumegopu commented 7 months ago

I haven't modified the code that much, here I share the relevant part regarding the error: with g2.as_default():

if __name__ == '__main__':

    # Check the gazebo connection
    "Publisher"
    #takeoff = rospy.Publisher('/bebop/takeoff',Empty, queue_size= 10)
    #land = rospy.Publisher('/bebop/land', Empty, queue_size= 10)

    "Subscribe"
    rospy.init_node('D3QN_TEST', anonymous=True)
    rospy.Subscriber('/camera/color/image_raw', Image, callback_camera, queue_size = 10)
    #The name of the ros topic from Xinghua /camera/infra1/image_rect_raw
    #RGB /camera/color/image_raw  -- grayscale /camera/depth/image_rect_raw
    # Parameter setting for the simulation
    agent = TestAgent(action_size = 8)  ## class name should be different from the original one
    #Change agent.load_model("./Saved_models/D3QN_V_3_single.h5")
    agent.load_model("/home/jaume/catkin_ws/src/Collision-avoidance/save_model/D3QN_V_3_single.h5")

I don't fully understand what do you mean when you ask how I implement the code so I hope this would help.

mw9385 commented 7 months ago

Ummm, maybe trouble with tensorflow version. Take a look at the issue #5.