During reset, most GPIOs are in floating state, and few ones has already PullUps, such GPIO2/GPIO0.
therefore, depending of your circuit, you probably need either adding PullDown, or adding small MOFSETs to invert the states, and doing change to your software accordingly.
In other words, you need to adapt the circuit/software so that idle state of the pins is matching with the OFF state of motor's drivers.