get_avatar() is not working in my custom theme

I have used this code to display author image. It was working in Local By FlyWheel but isn't working on a live site. It's not working means that it is not producing any HTML.

?php
   $post_id     = get_the_ID();
   $author_ID   = get_post_field( 'post_author', $post_id );
   echo get_avatar( $author_ID, 32);
?

Topic avatar theme-development Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.