In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of "how keras modifies backend". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to modify backend in keras" can help you solve the problem.
Method 1
Create a new .keras folder under the users folder, and create a new keras.json file under the folder. The json content is as follows:
{"image_dim_ordering": "tf", "epsilon": 1e-07, "floatx": "float32", "backend": "tensorflow"}
The backend can be tensorflow or theano, provided that you have already installed it.
But the drawback of the above approach is that you need to manually modify the file every time you want to switch backend, so wouldn't it be better to have a way to modify it dynamically? Take a look at the following methods:
Method 2import osos.environ ['KERAS_BACKEND'] =' tensorflow'import keras.backend as KK.set_image_dim_ordering ('tf')
First load the os library, change the backend of keras to tensorflow, then load the backend of keras, and set the order to tensorflow format.
Add: resolve the Using TensorFlow backend error after the introduction of keras
Question:
After retrieving keras-gpu,apply with Anaconda, the relevant cuddn and tensorflow-gpu and their corresponding versions should be automatically matched in theory, but there are some errors such as title errors and a bunch of errors when running the program.
According to a bunch of online methods to change, it is not easy to use. For example, add os.environ ['KERAS_BACKEND'] =' tensorflow-gpu', to update setup tool, etc.
Resolve:
Finally, by accident, the tensorflow-gpu version was modified on Anaconda from 1.10 to 1.80.
This is the end of the introduction to "how keras modifies backend". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.