controller.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:language-translation-english-to-french 作者: Satyaki0924 项目源码 文件源码
def main(choice):
        try:
            assert LooseVersion(tf.__version__) in [LooseVersion('1.0.0'), LooseVersion(
                '1.0.1')], 'This project requires TensorFlow version 1.0  You are using {}' \
                .format(tf.__version__)
            print('TensorFlow Version: {}'.format(tf.__version__))
            print('*****Author: Satyaki Sanyal*****')
            print('***This project must only be used for educational purpose***')
            if choice == 1:
                if not tf.test.gpu_device_name():
                    print('*** ERROR: No GPU found. Please use a GPU to train your neural network. ***')
                else:
                    print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
                    Main().main()

            elif choice == 2:
                Translate().translate()

            elif choice == 3:
                Plot().plot()

            else:
                print('*** Error: Wrong choice ***')
        except Exception as exc:
            print('*** Error: ' + str(exc) + ' ***')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号