Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me with this error --------------------------------------------------------------------------- ValueError Traceback (most recent call last) in () ----> 1 data = hdf . get ( 'model_weights'

Can someone help me with this error

image text in transcribed

 --------------------------------------------------------------------------- ValueError Traceback (most recent call last)  in () ----> 1 data = hdf.get('model_weights')  2 #dataset = np.array(data)  3 #print ('Shape of dataset: ', dataset.shape) C:\ProgramData\Anaconda3\lib\site-packages\h5py\_hl\group.py in get(self, name, default, getclass, getlink)  206 if not (getclass or getlink):  207 try: --> 208 return self[name]  209 except KeyError:  210 return default h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() C:\ProgramData\Anaconda3\lib\site-packages\h5py\_hl\group.py in __getitem__(self, name)  165 raise ValueError("Invalid HDF5 object reference")  166 else: --> 167 oid = h5o.open(self.id, self._e(name), lapl=self._lapl)  168  169 otype = h5i.get_type(oid) h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5o.pyx in h5py.h5o.open() ValueError: Not a location (invalid object ID) 
 --------------------------------------------------------------------------- ValueError Traceback (most recent call last)  in () ----> 1 data = hdf.get('model_weights')  2 #dataset = np.array(data)  3 #print ('Shape of dataset: ', dataset.shape) C:\ProgramData\Anaconda3\lib\site-packages\h5py\_hl\group.py in get(self, name, default, getclass, getlink)  206 if not (getclass or getlink):  207 try: --> 208 return self[name]  209 except KeyError:  210 return default h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() C:\ProgramData\Anaconda3\lib\site-packages\h5py\_hl\group.py in __getitem__(self, name)  165 raise ValueError("Invalid HDF5 object reference")  166 else: --> 167 oid = h5o.open(self.id, self._e(name), lapl=self._lapl)  168  169 otype = h5i.get_type(oid) h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\_objects.pyx in h5py._objects.with_phil.wrapper() h5py\h5o.pyx in h5py.h5o.open() ValueError: Not a location (invalid object ID) 
1 import numpy as np 2 import h5py 3 4 filename - "yolo.hs" h5 = h5py. File(filename,'r') 7 8 h5.close() In [3] 1 import numpy as np 2 import h5py 3 4 with h5py.File( 'yolo.h5', 'r) as hdf: ls = list (hdf , keys()) print(' List of datasets in this file : ", ls) List of datasets in this file: I'model_weights'] In [9]: 1 data=hdf.get('model-weights') 2 #dataset = np.array(data) 3| #print ("Shape of dataset: ", dataset.shape)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Implementing Ai And Machine Learning For Business Optimization

Authors: Robert K Wiley

1st Edition

B0CPQJW72N, 979-8870675855

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago

Question

What is job rotation ?

Answered: 1 week ago