我的问题与此类似。
我还使用泡菜来保存和加载模型。我在 pickle.load() 期间遇到以下错误
from sklearn.preprocessing import StandardScaler
# SAVE
scaler = StandardScaler().fit(X_train)
X_trainScale = scaler.transform(X_train)
pickle.dump(scaler, open('scaler.scl','wb'))
# =================
# LOAD
sclr = pickle.load(open('scaler.scl','rb')) # => ModuleNotFoundError: No module named 'sklearn.preprocessing._data'
X_testScale = sclr.transform(X_test)
Run Code Online (Sandbox Code Playgroud)
ModuleNotFoundError:没有名为“sklearn.preprocessing._data”的模块
看起来像是 sklearn 版本问题。我的 sklearn 版本是 0.20.3,Python 版本是 3.7.3。
但我在 Anaconda .zip 文件中使用 Python。是否可以在不更新 sklearn 版本的情况下解决此问题?
我使用 KeyStore (Android 9) 生成 AES 密钥,并使用isInsideSecureHardware()方法检查密钥是否isInsideSecureHardware。我得到了 return False。示例代码可以在此处和此处找到。
公共布尔 isInsideSecureHardware ()
如果密钥驻留在安全硬件(例如,可信执行环境 (TEE) 或安全元件 (SE))内,则返回 true。此类密钥的密钥材料仅在安全硬件内部以明文形式提供,并且不会暴露在安全硬件外部。
因此,我想进一步确认我的手机设备(华为P20)是否支持TEE。
问题:
如果手机支持TEE,KeyStore生成的密钥会自动存储到TEE中吗?我需要在 Java 中进行任何手动配置吗?我听说只要使用KeyStore.getInstance()、KeyGenerator .getInstance(algorithm, KeyStore Name) ,密钥就会自动存储在 TEE 中。但我不确定这是真的还是假的?
如果问题1的答案是“需要手动配置”,那就成为isInsideSecureHardware () 返回False的原因,对吧?如果 Q1 的答案是“自动”,则忽略 Q2。
有什么方法可以在Java中直接检查手机是否支持TEE?
我正在测试这个OpenSSL AES-128 CTR 模式加密。
\n\n#include <openssl/aes.h>\n#include <openssl/rand.h>\n#include <stdio.h>\n#include <string.h>\nRun Code Online (Sandbox Code Playgroud)\n\n我收到此错误(用 C++ 构建):
\n\n../src/AES_OpenSSL_CTR.cpp:128:3: error: \xe2\x80\x98AES_ctr128_encrypt\xe2\x80\x99 was not declared in this scope.\nRun Code Online (Sandbox Code Playgroud)\n\n我已经包含了openssl/aes.h。AES_ctr128_encrypt 已从 OpenSSL 1.1.1.c 中删除?为什么还不宣布?
\n