---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_23207/4182898696.py in <module>
45 monitor='loss') # 由于
46
---> 47 history = model.fit(x_train, y_train, batch_size=32, epochs=100, callbacks=[cp_callback])
48
49 model.summary()
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs)
725 max_queue_size=max_queue_size,
726 workers=workers,
--> 727 use_multiprocessing=use_multiprocessing)
728
729 def evaluate(self,
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_arrays.py in fit(self, model, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_freq, **kwargs)
641 steps=steps_per_epoch,
642 validation_split=validation_split,
--> 643 shuffle=shuffle)
644
645 if validation_data:
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, batch_size, check_steps, steps_name, steps, validation_split, shuffle, extract_tensors_from_dataset)
2430 is_compile_called = False
2431 if not self._is_compiled and self.optimizer:
-> 2432 self._compile_from_inputs(all_inputs, y_input, x, y)
2433 is_compile_called = True
2434
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py in _compile_from_inputs(self, all_inputs, target, orig_inputs, orig_target)
2665 sample_weight_mode=self.sample_weight_mode,
2666 run_eagerly=self.run_eagerly,
-> 2667 experimental_run_tf_function=self._experimental_run_tf_function)
2668
2669 # TODO(omalleyt): Consider changing to a more descriptive function name.
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py in _method_wrapper(self, *args, **kwargs)
455 self._self_setattr_tracking = False # pylint: disable=protected-access
456 try:
--> 457 result = method(self, *args, **kwargs)
458 finally:
459 self._self_setattr_tracking = previous_value # pylint: disable=protected-access
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py in compile(self, optimizer, loss, metrics, loss_weights, sample_weight_mode, weighted_metrics, target_tensors, distribute, **kwargs)
341 self.loss_functions, target_tensors):
342 endpoint = _TrainingEndpoint(o, n, l)
--> 343 endpoint.create_training_target(t, run_eagerly=self.run_eagerly)
344 self._training_endpoints.append(endpoint)
345
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py in create_training_target(self, target, run_eagerly)
3060 if target is None:
3061 target_dtype = losses.LABEL_DTYPES_FOR_LOSSES.get(
-> 3062 self.loss_fn, K.dtype(self.output))
3063
3064 target = K.placeholder(
/home/software/anaconda3/envs/tf115/lib/python3.7/site-packages/tensorflow_core/python/keras/backend.py in dtype(x)
1241 ```
1242 """
-> 1243 return x.dtype.base_dtype.name
1244
1245
AttributeError: 'NoneType' object has no attribute 'dtype'
AttributeError:“ NoneType”对象没有属性“ dtype”
可能是Numpy和TensorFlow兼容性问题。
目前使用的是TensorFlow2.1版本,于是将Numpy版本修改为1.18.5,发现问题得到解决
- Center-based 3D Object Detection and Tracking
- 【五期李伟平】CCF-A(AAAI'21)Game of Gradients: Mitigating Irrelevant Clients in Federated Learning
- 2024-01-13 Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. ==》引用了未使用的方法导致
- Python中出现"No module named 'requests'"的图文解决办法
- ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password'
- mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; ERROR 1410 (42000): You are not allowed to create a user with GRANT
- mybatis提示com.microsoft.sqlserver.jdbc.SQLServerException: 列名 'xxxx' 无效。
- Flutter 项目运行到ios模拟器报错 : Error (Xcode): SDK does not contain 'libarclite'
- 初中英语优秀范文100篇-055My Father's Job-我父亲的工作
- SpringBoot配置报错:Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Reason: Failed to determine a suitable driver class
本栏目推荐文章
- 39 AttributeError attribute NoneType object39 attributeerror attribute nonetype 39 attribute nonetype object attributeerror containers attribute nonetype 39 attribute nonetype children 39 quot attributeerror attribute 39 attributeerror antialias attribute 39 attributeerror tensorflow attribute 39 attributeerror attribute copy_src 39 attributeerror attribute深度 v_flag_cb_issuer_check 39 attributeerror attribute