Not really. Failing is bad. It's better to not try at all if you're going to fail, unless you can learn something that makes you succeed in the future. Otherwise, trying will mean missed opportunity costs.
It is difficult to know whether you are going to fail, but easy to know whether you are going to try. Nobody sets out to fail.