When using the tensorflow C++ API, the error You must define TF_LIB_GTL_ALIGNED_CHAR_ARRAY for your compiler.
The reason is as follows (see reference).
If you omit the
COMPILER_MSVCdefinition, you will run into an error saying “You must define
TF_LIB_GTL_ALIGNED_CHAR_ARRAYfor your compiler.” If you omit the
NOMINMAXdefinition, you will run into a number of errors saying “’(‘: illegal token on right side of ‘::’”. (The reason for this is that
<Windows.h>gets included somewhere, and Windows has macros that redefine
max. These macros are disabled with
Add at the beginning of the code
#pragma once #define COMPILER_MSVC #define NOMINMAX
Take vs2017 as an example: attribute Manager — > C/C + + –> preprocessor definition
Paste in the following
put things right once and for all!
- Visual Studio 2012 error C4996: ‘scanf’: This function or variable may be unsafe.
- Tensorflow error: attributeerror: module ‘tensorflow_ API. V1. Train ‘has no attribute’ summarywriter ‘
- (Keil MDK) UCOS floating point support abnormal solution
- Error 2 error c2491: XX: definition of dllimport static data member is not allowed
- Keil’s duplicate definition problem: Error: L6200E: Symbol F6x8 multiply defined
- TensorFlow issue: Expected int32, got list containing Tensors of type ‘_Message’ instead.
- How to Solve TypeError: type numpy.ndarray doesn‘t define __round__ method
- [Solved] ORA-21525: attribute number or (collection element at index) string violated its constraints
- A mistake about implicitly providing default constructors
- Hash_map is deprecated and will be REMOVED. Please use unordered_map.
- Error using tensorflow GPU: could not create cudnn handle: cudnn_STATUS_NOT_INITIALIZED
- Error (active) e1696 cannot open source file “errno.H” rpgworld problems encountered in installing visual studio 2017
- Error in Tensorflow using variables: List of Tensors when single Tensor expected
- Cmake Error The C compiler identification is GNU 7.5.0 — The CXX compiler identification is unknown
- How to Avoid Windows Error in Gitbook Serve
- Oracle prompt text does not match format string
- Compile .h file with error “error: backslash-newline at end of file [-Werror]：
- Excel VBA on error resume next error handling
- SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. Error code 0xC020801C,0xC02…
- ValueError: Input 0 of node import/save/Assign was passed float from import/beta1_power:0 incompatib