Robot manipulators are highly nonlinear system with multi-inputs multi-outputs, and various control methods for the robot manipulators have been developed to acquire good trajectory tracking performance and improve the system stability lately. The computed torque controller has nonlinear feedforward control elements and so it is very effective to control robot manipulators. If the control gains of the computed torque controller is adjusted according the payload, then more precise control performance is attained. This paper extends the conventional computed torque controller in the joint space to the Cartesian space, and optimize the control gains for some specified payloads in both joint and Cartesian spaces using genetic algorithms. Also a neural network is employed to have proper control gains for arbitrary payloads using generalization properties of the neural network. Computer simulation results show that the proposed control system for robot manipulators has excellent performance in various conditions.