Hi. I just read a lot of comments about frogs and toads...and a comment about e-collars, but I don't think I saw any helpful advice. May I?
Here's what I do with dogs that try to eat something they aren't supposed to (for me, it's always puppies that like to eat dirt/sand/leaves. They get super expensive kibble, then try to snack on dirt. Sigh...)
Get your training pouch. Get two (at least) actually. Fill them with the very best treats you can find. Try to make the treats as different as possible, like dehydrated salmon and then Real Meat chicken or beef. Fill the pouches. Don't mix the food. One pouch per food. Now put these (I hang them) next to the door where the dog goes out to where the garden is. EVERY SINGLE TIME YOU GO OUTSIDE, you're going to snag one of the training pouches of food
Foundation work (in the house): Put on your training pouch. Before you start, put some boring toys (or something else safe that he's not very interested in, like empty water bottles) on the floor. As soon as he goes to sniff it, put some of your fabulous treat right in front of his nose and say, "Hey (his name!) Whacha Got?" in a super happy voice and lure him a step away and feed him the food. Repeat this numerous time, increasing the steps until he swings his head around and starts to trot toward you. "Hey Fido, Whatcha Got?" is a long cue, but it's something you can't yell at him annoyed or in a mad voice. You're always happy to see what he's got. Ultimately, we want him to put it in your hand (or if it's something gross to drop it. I trust you have trained or know how to train Drop it and Give separately? If not, let me know)
The point is that if he's picked it up, he'll either leave it alone and walk to you or bring it to you and give it to you because he can't take a mouthful of treats if he has something else in his mouth, right? I also do this with my puppies when they find random socks or bits of paper in the house. They help me clean up the house.
Be sure you swap out your treats. Be on the look out for the best treats you can find. Unpredictability (random reinforcers) are effective, so once in a while, string cheese or even crunchy (not stale) Cheerios are kind of awesome. He's always giving up something he likes, so you have to give him something better or something he's never had before. It's the upgrade game. Try to not use his regular treats if possible.
Ok, so outside, start all over. Outside is more distracting. If he starts sniffing a rock or a leaf, ask him "Hey Fido, Whatcha Got?" and treat him as soon as he turns around and starts to you, even if he wasn't actually picking it up. We want him to know that the rules apply outside too. The rules are, "My human asks me what I've got, and I whip my head around and run to them." Avoid trying to pull away from favorite toys because for some of our kids, favorite toys are better than treats. Boring ole outside toys, though, are fun to practice on.
It's an awesome game for a dog.
Now, when he sees a frog, if you see it first, don't wait for him to go near it. Likely, though, he'll see it first, and you just ask him what he's got.
Advanced Level:
Once he's got the game down and he usually brings things to you *consistently* (months for a dog that's obsessed with something) I then raise my standard. If my dog swallows a leaf trotting over to me, then he doesn't get the treat. "Aww... Too bad!" play (It's not "no" which is a reprimand, but "aww" which is more playful. You're on his team and you really want him to win. The language you use is important because it affects how you go into and stay in his. You're training him, but you're not using positive punishment. You're on team).
But before I get to that point, I want my dog to get into the habit of always returning to me with the offending thing in his mouth, so I'll reinforce that behavior (the whipping his head around and coming to me).
At first, also, give him a small handful of treats. Don't be stingy. You can give him more reasonable amounts later. But whenever we're trying to extinguish a behavior a dog really enjoys, we need to make sure that the new behavior that we are training as an alternate is more rewarding.
Here's the thing: you're trying to overcome what is or can become an obsessive behavior. If we punish it, we can make it more obsessive. If we try to catch/grab the dog to take it out of his mouth, we're chasing him, which is awesome for him. We have to train an alternate behavior so that the object of his obsessions loses its value, and the best way to do that is by making our game more fun.
Does all this make sense?
I will also add that I have a huge garden, and it's entirely fenced with pasture fencing (basically chicken wire). Lots of bad stuff can grow in gardens, starting with mushrooms, mold, and poisonous plants, including things like tomato plants and too many flowers to list (so regardless of the type of garden, gardens aren't safe for the average dog.)
The first step of owning a dog isn't training. It's management. Keep the dog out of places that aren't safe for them. Building a fence may be your easiest solution if you don't have time to do everything I listed above.