x64控制台与MFC控制台同样的配置;
关键C++代码如下:
#define PY_modePath L"E:\\Anaconda\\envs\\asr\\"
Py_SetPythonHome(PY_modePath);
pModule = PyImport_ImportModule(aasr.c_str());//mfc是null 控制台是OK的
python代码如下:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: sly
"""
import platform as plat
import os
import time
from general_function.file_wav import *
from general_function.file_dict import *
from general_function.gen_func import *
import numpy as np
import random
from keras.models import Sequential, Model
from keras.layers import Dense, Dropout, Input, Reshape, BatchNormalization # , Flatten
from keras.layers import Lambda, TimeDistributed, Activation,Conv2D, MaxPooling2D #, Merge
from keras import backend as K
from keras.optimizers import SGD, Adadelta, Adam
路径检查多边没有问题.
对边了加载脚本时C++输出: