You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @stuarteiffert ,
thank you for your code!Really nice work! Could you help me solving the following problem? I want to do inference with a new X-train.txt that I've already and I'm trying to save the model and then restore it but i got an error with the h5 file.
Could you provide me some suggestions?
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras.models import Sequential
from tensorflow.keras.models import save_model, load_model
from tensorflow.keras.utils import to_categorical
import numpy as np
import argparse
import cv2
import time
import os
import matplotlib
import matplotlib.pyplot as plt
from sklearn import metrics
import random
from random import randint
import tensorflow as Saver
import tensorflow.compat.v1 as tf
import tensorflow.compat.v1.train as Saver
from keras.callbacks import ModelCheckpoint
import h5py as h5
n_steps = 32
def load_X(X_path):
file = open(X_path, 'r')
X_ = np.array(
[elem for elem in [
row.split(',') for row in file
]],
dtype=np.float32
)
file.close()
blocks = int(len(X_) / n_steps)
X_ = np.array(np.split(X_,blocks))
return X_
DATASET_PATH ='/home/oli/Desktop/human-pose-detection/train2/'
filepath = '/home/oli/Desktop/human-pose-detection/model.ckpt.meta'
new_model = load_model(filepath, compile = True)
X_val_path = DATASET_PATH + "X_test.txt"
X_val = load_X(X_val_path)
predictions = new_model.predict(X_val)
print(predictions)
Best regards,
Olivia
The text was updated successfully, but these errors were encountered:
Hello @stuarteiffert ,
thank you for your code!Really nice work! Could you help me solving the following problem? I want to do inference with a new X-train.txt that I've already and I'm trying to save the model and then restore it but i got an error with the h5 file.
Could you provide me some suggestions?
Best regards,
Olivia
The text was updated successfully, but these errors were encountered: