我正在关注有关基本CNN和keras(Tensorflow后端)Conv2D层的2个不同的教程。
当我用相同的层(以我的观点)交换一层时,用不同的表示法,我的模型会完全失败,并且从〜95%的精度变为低于20%的精度。
显然必须存在一个我没有发现的重大差异!
这是我的工作模型,可以正常工作:
symbol: class SSLClientSessionCache
location: class SSLSessionCache
frameworks/base/core/java/com/android/internal/backup/LocalTransport.java:36: error: package com.android.org.bouncycastle.util.encoders does not exist
import com.android.org.bouncycastle.util.encoders.Base64;
^
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:19: error: package com.android.org.bouncycastle.x509 does not exist
import com.android.org.bouncycastle.x509.X509V3CertificateGenerator;
^
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:21: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.NativeCrypto;
^
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:22: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.OpenSSLEngine;
^
frameworks/base/keystore/java/android/security/KeyStore.java:19: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.NativeCrypto;
^
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:19: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.NativeCrypto;
^
frameworks/base/keystore/java/android/security/AndroidKeyStore.java:19: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.OpenSSLEngine;
^
frameworks/base/keystore/java/android/security/AndroidKeyStore.java:20: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.OpenSSLKeyHolder;
^
frameworks/base/keystore/java/android/security/Credentials.java:23: error: package com.android.org.bouncycastle.util.io.pem does not exist
import com.android.org.bouncycastle.util.io.pem.PemObject;
^
frameworks/base/keystore/java/android/security/Credentials.java:24: error: package com.android.org.bouncycastle.util.io.pem does not exist
import com.android.org.bouncycastle.util.io.pem.PemReader;
^
frameworks/base/keystore/java/android/security/Credentials.java:25: error: package com.android.org.bouncycastle.util.io.pem does not exist
import com.android.org.bouncycastle.util.io.pem.PemWriter;
^
frameworks/base/keystore/java/android/security/KeyChain.java:43: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.OpenSSLEngine;
^
frameworks/base/keystore/java/android/security/KeyChain.java:44: error: package com.android.org.conscrypt does not exist
import com.android.org.conscrypt.TrustedCertificateStore;
^
frameworks/base/core/java/android/app/ActivityThread.java:989: error: cannot find symbol
long openSslSocketCount = Debug.countInstancesOfClass(OpenSSLSocketImpl.class);
^
symbol: class OpenSSLSocketImpl
location: class ActivityThread.ApplicationThread
frameworks/base/core/java/android/app/ActivityThread.java:5236: error: cannot find symbol
TrustedCertificateStore.setDefaultUserDirectory(configDir);
^
symbol: variable TrustedCertificateStore
location: class ActivityThread
frameworks/base/core/java/android/app/admin/DevicePolicyManager.java:1869: error: cannot find symbol
final TrustedCertificateStore certStore = new TrustedCertificateStore();
^
symbol: class TrustedCertificateStore
location: class DevicePolicyManager
frameworks/base/core/java/android/app/admin/DevicePolicyManager.java:1869: error: cannot find symbol
final TrustedCertificateStore certStore = new TrustedCertificateStore();
^
symbol: class TrustedCertificateStore
location: class DevicePolicyManager
frameworks/base/core/java/android/app/admin/DevicePolicyManager.java:1892: error: cannot find symbol
for (String alias : new TrustedCertificateStore().userAliases()) {
^
symbol: class TrustedCertificateStore
location: class DevicePolicyManager
frameworks/base/core/java/android/app/admin/DevicePolicyManager.java:1956: error: cannot find symbol
return new TrustedCertificateStore().getCertificateAlias(cert);
^
symbol: class TrustedCertificateStore
location: class DevicePolicyManager
frameworks/base/core/java/android/net/Network.java:224: error: cannot find symbol
mHostResolver = new HostResolver() {
^
symbol: class HostResolver
location: class Network
frameworks/base/core/java/android/net/Network.java:232: error: cannot find symbol
mConnectionPool = new ConnectionPool(httpMaxConnections,
^
symbol: class ConnectionPool
location: class Network
frameworks/base/core/java/android/net/Network.java:281: error: cannot find symbol
OkHttpClient client;
^
symbol: class OkHttpClient
location: class Network
frameworks/base/core/java/android/net/Network.java:285: error: cannot find symbol
client = HttpHandler.createHttpOkHttpClient(proxy);
^
symbol: variable HttpHandler
location: class Network
frameworks/base/core/java/android/net/Network.java:287: error: cannot find symbol
client = HttpsHandler.createHttpsOkHttpClient(proxy);
^
symbol: variable HttpsHandler
location: class Network
frameworks/base/core/java/android/net/http/CertificateChainValidator.java:231: error: cannot find symbol
X509TrustManager x509TrustManager = SSLParametersImpl.getDefaultX509TrustManager();
^
symbol: variable SSLParametersImpl
location: class CertificateChainValidator
frameworks/base/core/java/android/net/http/CertificateChainValidator.java:232: error: cannot find symbol
if (x509TrustManager instanceof TrustManagerImpl) {
^
symbol: class TrustManagerImpl
location: class CertificateChainValidator
frameworks/base/core/java/android/net/http/CertificateChainValidator.java:233: error: cannot find symbol
TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
^
symbol: class TrustManagerImpl
location: class CertificateChainValidator
frameworks/base/core/java/android/net/http/CertificateChainValidator.java:233: error: cannot find symbol
TrustManagerImpl trustManager = (TrustManagerImpl) x509TrustManager;
^
symbol: class TrustManagerImpl
location: class CertificateChainValidator
frameworks/base/core/java/android/net/http/HttpsConnection.java:75: error: cannot find symbol
SSLClientSessionCache cache = null;
^
symbol: class SSLClientSessionCache
location: class HttpsConnection
frameworks/base/core/java/android/net/http/HttpsConnection.java:79: error: cannot find symbol
cache = FileClientSessionCache.usingDirectory(sessionDir);
^
symbol: variable FileClientSessionCache
location: class HttpsConnection
frameworks/base/core/java/android/net/http/HttpsConnection.java:82: error: cannot find symbol
OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
^
symbol: class OpenSSLContextImpl
location: class HttpsConnection
frameworks/base/core/java/android/net/http/HttpsConnection.java:82: error: cannot find symbol
OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
^
symbol: class OpenSSLContextImpl
location: class HttpsConnection
frameworks/base/core/java/android/net/http/SslCertificate.java:379: error: cannot find symbol
X509Name x509Name = new X509Name(dName);
^
symbol: class X509Name
location: class SslCertificate.DName
frameworks/base/core/java/android/net/http/SslCertificate.java:379: error: cannot find symbol
X509Name x509Name = new X509Name(dName);
^
symbol: class X509Name
location: class SslCertificate.DName
frameworks/base/core/java/android/net/http/SslCertificate.java:385: error: cannot find symbol
if (oid.elementAt(i).equals(X509Name.CN)) {
^
symbol: variable X509Name
location: class SslCertificate.DName
frameworks/base/core/java/android/net/http/SslCertificate.java:392: error: cannot find symbol
if (oid.elementAt(i).equals(X509Name.O)) {
^
symbol: variable X509Name
location: class SslCertificate.DName
frameworks/base/core/java/android/net/http/SslCertificate.java:399: error: cannot find symbol
if (oid.elementAt(i).equals(X509Name.OU)) {
^
symbol: variable X509Name
location: class SslCertificate.DName
frameworks/base/core/java/android/net/http/HttpResponseCache.java:164: error: package com.android.okhttp does not exist
if (installed instanceof com.android.okhttp.HttpResponseCache) {
^
frameworks/base/core/java/android/net/http/HttpResponseCache.java:166: error: package com.android.okhttp does not exist
(com.android.okhttp.HttpResponseCache) installed);
^
frameworks/base/core/java/android/net/http/HttpResponseCache.java:185: error: package com.android.okhttp does not exist
if (installed instanceof com.android.okhttp.HttpResponseCache) {
^
frameworks/base/core/java/android/net/http/HttpResponseCache.java:186: error: package com.android.okhttp does not exist
com.android.okhttp.HttpResponseCache installedCache =
^
frameworks/base/core/java/android/net/http/HttpResponseCache.java:187: error: package com.android.okhttp does not exist
(com.android.okhttp.HttpResponseCache) installed;
^
frameworks/base/core/java/android/net/http/HttpResponseCache.java:199: error: package com.android.okhttp does not exist
com.android.okhttp.HttpResponseCache responseCache =
^
frameworks/base/core/java/android/net/http/HttpResponseCache.java:200: error: package com.android.okhttp does not exist
new com.android.okhttp.HttpResponseCache(directory, maxSize);
^
frameworks/base/core/java/android/net/http/X509TrustManagerExtensions.java:48: error: cannot find symbol
if (tm instanceof TrustManagerImpl) {
^
symbol: class TrustManagerImpl
location: class X509TrustManagerExtensions
frameworks/base/core/java/android/net/http/X509TrustManagerExtensions.java:49: error: cannot find symbol
mDelegate = (TrustManagerImpl) tm;
^
symbol: class TrustManagerImpl
location: class X509TrustManagerExtensions
frameworks/base/core/java/android/net/PskKeyManager.java:119: error: cannot find symbol
PSKKeyManager.MAX_IDENTITY_HINT_LENGTH_BYTES;
^
symbol: variable PSKKeyManager
location: class PskKeyManager
frameworks/base/core/java/android/net/PskKeyManager.java:122: error: cannot find symbol
public static final int MAX_IDENTITY_LENGTH_BYTES = PSKKeyManager.MAX_IDENTITY_LENGTH_BYTES;
^
symbol: variable PSKKeyManager
location: class PskKeyManager
frameworks/base/core/java/android/net/PskKeyManager.java:125: error: cannot find symbol
public static final int MAX_KEY_LENGTH_BYTES = PSKKeyManager.MAX_KEY_LENGTH_BYTES;
^
symbol: variable PSKKeyManager
location: class PskKeyManager
frameworks/base/core/java/android/net/PskKeyManager.java:136: error: method does not override or implement a method from a supertype
@Override
^
frameworks/base/core/java/android/net/PskKeyManager.java:150: error: method does not override or implement a method from a supertype
@Override
^
frameworks/base/core/java/android/net/PskKeyManager.java:167: error: method does not override or implement a method from a supertype
@Override
^
frameworks/base/core/java/android/net/PskKeyManager.java:184: error: method does not override or implement a method from a supertype
@Override
^
frameworks/base/core/java/android/net/PskKeyManager.java:202: error: method does not override or implement a method from a supertype
@Override
^
frameworks/base/core/java/android/net/PskKeyManager.java:220: error: method does not override or implement a method from a supertype
@Override
^
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:211: error: cannot find symbol
OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
^
symbol: class OpenSSLContextImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:211: error: cannot find symbol
OpenSSLContextImpl sslContext = new OpenSSLContextImpl();
^
symbol: class OpenSSLContextImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:419: error: cannot find symbol
if (!(socket instanceof OpenSSLSocketImpl)) {
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:424: error: cannot find symbol
return (OpenSSLSocketImpl) socket;
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:435: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(k, host, port, close);
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:435: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(k, host, port, close);
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:456: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket();
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:456: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket();
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:474: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:474: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:492: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(addr, port);
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:492: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(addr, port);
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:509: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:509: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:529: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(host, port);
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLCertificateSocketFactory.java:529: error: cannot find symbol
OpenSSLSocketImpl s = (OpenSSLSocketImpl) getDelegate().createSocket(host, port);
^
symbol: class OpenSSLSocketImpl
location: class SSLCertificateSocketFactory
frameworks/base/core/java/android/net/SSLSessionCache.java:59: error: cannot find symbol
if (clientContext instanceof ClientSessionContext) {
^
symbol: class ClientSessionContext
location: class SSLSessionCache
frameworks/base/core/java/android/net/SSLSessionCache.java:60: error: cannot find symbol
((ClientSessionContext) clientContext).setPersistentCache(
^
symbol: class ClientSessionContext
location: class SSLSessionCache
frameworks/base/core/java/android/net/SSLSessionCache.java:75: error: cannot find symbol
mSessionCache = (SSLClientSessionCache) cache;
^
symbol: class SSLClientSessionCache
location: class SSLSessionCache
frameworks/base/core/java/android/net/SSLSessionCache.java:87: error: cannot find symbol
mSessionCache = FileClientSessionCache.usingDirectory(dir);
^
symbol: variable FileClientSessionCache
location: class SSLSessionCache
symbol: variable OpenSSLEngine
location: class AndroidKeyPairGenerator
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:122: error: cannot find symbol
final X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();
^
symbol: class X509V3CertificateGenerator
location: class AndroidKeyPairGenerator
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:122: error: cannot find symbol
final X509V3CertificateGenerator certGen = new X509V3CertificateGenerator();
^
symbol: class X509V3CertificateGenerator
location: class AndroidKeyPairGenerator
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:170: error: cannot find symbol
case NativeCrypto.EVP_PKEY_RSA:
^
symbol: variable NativeCrypto
location: class AndroidKeyPairGenerator
frameworks/base/keystore/java/android/security/AndroidKeyPairGenerator.java:176: error: cannot find symbol
case NativeCrypto.EVP_PKEY_DSA:
^
symbol: variable NativeCrypto
location: class AndroidKeyPairGenerator
frameworks/base/keystore/java/android/security/KeyStore.java:73: error: cannot find symbol
return NativeCrypto.EVP_PKEY_RSA;
^
symbol: variable NativeCrypto
location: class KeyStore
frameworks/base/keystore/java/android/security/KeyStore.java:75: error: cannot find symbol
return NativeCrypto.EVP_PKEY_DSA;
^
symbol: variable NativeCrypto
location: class KeyStore
frameworks/base/keystore/java/android/security/KeyStore.java:77: error: cannot find symbol
return NativeCrypto.EVP_PKEY_EC;
^
symbol: variable NativeCrypto
location: class KeyStore
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:168: error: cannot find symbol
if (keyType == NativeCrypto.EVP_PKEY_DSA) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:170: error: cannot find symbol
} else if (keyType == NativeCrypto.EVP_PKEY_EC) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:172: error: cannot find symbol
} else if (keyType == NativeCrypto.EVP_PKEY_RSA) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:179: error: cannot find symbol
if (keyType == NativeCrypto.EVP_PKEY_DSA) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:184: error: cannot find symbol
} else if (keyType == NativeCrypto.EVP_PKEY_EC) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:189: error: cannot find symbol
} else if (keyType == NativeCrypto.EVP_PKEY_RSA) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:201: error: cannot find symbol
if (keyType == NativeCrypto.EVP_PKEY_DSA && spec != null) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java:205: error: cannot find symbol
} else if (keyType == NativeCrypto.EVP_PKEY_RSA && spec != null) {
^
symbol: variable NativeCrypto
location: class KeyPairGeneratorSpec
frameworks/base/keystore/java/android/security/AndroidKeyStore.java:84: error: cannot find symbol
final OpenSSLEngine engine = OpenSSLEngine.getInstance("keystore");
^
symbol: class OpenSSLEngine
location: class AndroidKeyStore
frameworks/base/keystore/java/android/security/AndroidKeyStore.java:84: error: cannot find symbol
final OpenSSLEngine engine = OpenSSLEngine.getInstance("keystore");
^
symbol: variable OpenSSLEngine
location: class AndroidKeyStore
frameworks/base/keystore/java/android/security/AndroidKeyStore.java:216: error: cannot find symbol
if (key instanceof OpenSSLKeyHolder) {
^
symbol: class OpenSSLKeyHolder
location: class AndroidKeyStore
frameworks/base/keystore/java/android/security/AndroidKeyStore.java:217: error: cannot find symbol
pkeyAlias = ((OpenSSLKeyHolder) key).getOpenSSLKey().getAlias();
^
symbol: class OpenSSLKeyHolder
location: class AndroidKeyStore
frameworks/base/keystore/java/android/security/Credentials.java:130: error: cannot find symbol
PemWriter pw = new PemWriter(writer);
^
symbol: class PemWriter
location: class Credentials
frameworks/base/keystore/java/android/security/Credentials.java:130: error: cannot find symbol
PemWriter pw = new PemWriter(writer);
^
symbol: class PemWriter
location: class Credentials
frameworks/base/keystore/java/android/security/Credentials.java:132: error: cannot find symbol
pw.writeObject(new PemObject("CERTIFICATE", o.getEncoded()));
^
symbol: class PemObject
location: class Credentials
frameworks/base/keystore/java/android/security/Credentials.java:145: error: cannot find symbol
PemReader pr = new PemReader(reader);
^
symbol: class PemReader
location: class Credentials
frameworks/base/keystore/java/android/security/Credentials.java:145: error: cannot find symbol
PemReader pr = new PemReader(reader);
^
symbol: class PemReader
location: class Credentials
frameworks/base/keystore/java/android/security/Credentials.java:150: error: cannot find symbol
PemObject o;
^
symbol: class PemObject
location: class Credentials
frameworks/base/keystore/java/android/security/KeyChain.java:323: error: cannot find symbol
final OpenSSLEngine engine = OpenSSLEngine.getInstance("keystore");
^
symbol: class OpenSSLEngine
location: class KeyChain
frameworks/base/keystore/java/android/security/KeyChain.java:323: error: cannot find symbol
final OpenSSLEngine engine = OpenSSLEngine.getInstance("keystore");
^
symbol: variable OpenSSLEngine
location: class KeyChain
frameworks/base/keystore/java/android/security/KeyChain.java:359: error: cannot find symbol
TrustedCertificateStore store = new TrustedCertificateStore();
^
symbol: class TrustedCertificateStore
location: class KeyChain
frameworks/base/keystore/java/android/security/KeyChain.java:359: error: cannot find symbol
TrustedCertificateStore store = new TrustedCertificateStore();
^
symbol: class TrustedCertificateStore
location: class KeyChain
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
141 errors
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar] Error 41
如果我替换第二层
model = Sequential()
model.add(Conv2D(64, kernel_size = 3, activation='relu', input_shape=(28,28,1)))
model.add(Conv2D(32, kernel_size = 3, activation='relu'))
model.add(Flatten())
model.add(Dense(10, activation='softmax'))
使用
model.add(Conv2D(32, kernel_size = 3, activation='relu'))
我已经读过,内核大小也可以在tupel中定义为(3,3),默认步幅大小为1x1。
为什么这种替换会导致完全不同的结果?