Building a neural network based on keras to realize the complete code data of pneumonia x-ray recognition

Pay complete code data ------

result:

Import library:

In [4]:

import re
import os
import random
import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt

try:
    tpu = tf.distribute.cluster_resolver.TPUClusterResolver.connect()
    print("Device:", tpu.master())
    strategy = tf.distribute.TPUStrategy(tpu)
except:
    strategy = tf.distribute.get_strategy()
print("Number of replicas:", strategy.num_replicas_in_sync)
Number of replicas: 1

In [5]:

AUTOTUNE = tf.data.AUTOTUNE#
BATCH_SIZE = 25 * strategy.num_replicas_in_sync
IMAGE_SIZE = [180, 180]
CLASS_NAMES = ["NORMAL&

Guess you like

Origin blog.csdn.net/qiqi_ai_/article/details/131581431