GPU Compute crashes while rendering but rendered mode works fine I am a 16 year old. I am new to this community as well as blender. When I was rendering today, I encountered a strange problem. When I try to render the below given scene using GPU COMPUTE it crashes, but GPU COMPUTE works absolutely fine in rendered mode. When I render using CPU, its all right. When I check my gpu stats in MSI AFTERBURNER,everything is fine. No temp throttling, No memory Bottleneck(only 2gb of vram was used out of 4gb). 
My Computer Specifications are :-


CPU :- AMD RYZEN 1600
RAM :- Corsair 16gb ddr4 3000mhz
GPU :- RX 480 4gb(Crimson 17.7.2)
HDD :- Two 7200rpm drives
MOBO :- Gigabyte GA-AB350 Gaming 3(BIOS :- F7a)

MY Problem is clearly shown in this video


And also, I Found that the GPU COMPUTE works fine in very simple renders (like the startup file render)

Any help from this community will be deeply appreciated.
The viewport render is designed to give you an approximation of the scene taking some shortcuts, usually renders using lower samples and using less subdivisions (depending on how the modifiers are set) and ignoring some other features that are only available on the final render. The idea behind this is to give you a more responsive interface.

More on this topic on this link

When you render using F12 you are using a lot more resources. If your scene's complexity exceeds the capabilities of your GPU, the render will fail is that simple.

Memory usage in afterburner might not reflect the real vRAM usage for the scene.

Your options are to simplify your scene (or break in smaller, renderable pieces to be composited together later) or to render using CPU.