Are you using CentOS ? , I did a quick test on CentOS and it seems no issue there. But the issue happens on Ubuntu 18.04
You can find the whole code on the github repo in the description , just change the 2 functions I wrote above and launch the script discrete_A3C.py .