Error message
Traceback (most recent call last):
File "tools/train.py", line 244, in <module>
main()
File "tools/train.py", line 233, in main
train_detector(
File "/home/christ/dev/repos/railsight/mmdetection-2.25.3/mmdet/apis/train.py", line 244, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 130, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/mmcv/runner/epoch_based_runner.py", line 47, in train
for i, data_batch in enumerate(self.data_loader):
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 368, in __iter__
return self._get_iterator()
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 965, in __init__
self._reset(loader, first_iter=True)
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 996, in _reset
self._try_put_index()
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1230, in _try_put_index
index = self._next_index()
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in _next_index
return next(self._sampler_iter) # may raise StopIteration
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/sampler.py", line 226, in __iter__
for idx in self.sampler:
File "/home/christ/dev/repos/railsight/mmdetection-2.25.3/mmdet/datasets/samplers/group_sampler.py", line 36, in __iter__
indices = np.concatenate(indices)
File "<__array_function__ internals>", line 180, in concatenate
ValueError: need at least one array to concatenate
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/multiprocessing/popen_fork.py", line 27, in poll
pid, sts = os.waitpid(self.pid, flag)
File "/home/christ/miniconda3/envs/mmdetection/lib/python3.8/site-packages/torch/utils/data/_utils/signal_handling.py", line 66, in handler
_error_if_any_worker_fails()
RuntimeError: DataLoader worker (pid 35413) is killed by signal: Terminated.
This is the error message I am faced with when trying to train using SSD with MMDetection. I have checked through my dataset and it works with faster_rcnn so I am not understanding why I am having such an issue with the SSD training. Any advice would be great!
_base_ = '../ssd/ssd300_coco.py'
dataset_type = 'CocoDataset'
classes = ('pantograph',)
data = dict(
train=dict(
img_prefix='configs/pantograph/train/',
classes=classes,
ann_file='configs/pantograph/train/SSDTrain.json',
dataset=dict(
ann_file='configs/pantograph/train/SSDTrain.json',
img_prefix='configs/pantograph/train/')),
val=dict(
img_prefix='configs/pantograph/val/',
classes=classes,
ann_file='configs/pantograph/val/SSDVal.json'),
test=dict(
img_prefix='configs/pantograph/test/',
classes=classes,
ann_file='configs/pantograph/test/SSDTest.json'))
Above is my custom SSD config that I tried to run. I have double checked the file locations and made sure they are all correct.
mmdet has a very good community, you can try to look at this link to solve your problem. Shortly, you should change your classes = ('pantograph',) as the following codes
cfg.metainfo = {
'classes': ('balloon', ),
'palette': [
(220, 20, 60),
]
}
I am trying to train a YOLO model on a custom dataset using YOLOv8 Ultralytics, using M1 MacBook Pro MPS acceleration which is supported by PyTorch but I am getting the following error while executing the train command.
Command:
!yolo task=detect mode=train model=yolov8s.pt data={HOME}/datasets/data.yaml epochs=25 device=mps
Error Message:
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/cli.py", line 56, in cli
func(cfg)
File "/opt/homebrew/lib/python3.10/site-packages/hydra/main.py", line 79, in decorated_main
return task_function(cfg_passthrough)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/v8/detect/train.py", line 207, in train
model.train(**cfg)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/engine/model.py", line 193, in train
self.trainer.train()
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/engine/trainer.py", line 185, in train
self._do_train(int(os.getenv("RANK", -1)), world_size)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/engine/trainer.py", line 301, in _do_train
self.loss, self.loss_items = self.criterion(preds, batch)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/v8/detect/train.py", line 77, in criterion
return self.compute_loss(preds, batch)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/v8/detect/train.py", line 168, in __call__
targets = self.preprocess(targets.to(self.device), batch_size, scale_tensor=imgsz[[1, 0, 1, 0]])
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
Is there any way to get around this issue and use MPS for training?
I have tried looking for this issue on PyTorch's GitHub conversation, but got no simple solution.
Edit:
I have set HYDRA_FULL_ERROR to 1, and this is the updated error traceback:
Error executing job with overrides: ['task=detect', 'mode=train', 'model=yolov8s.pt', 'data=/Users/aditya_nemiwal/Documents/C++/Python/WiDS_Week3_3/datasets/data.yaml', 'epochs=25', 'device=mps']
Traceback (most recent call last):
File "/opt/homebrew/bin/yolo", line 8, in <module>
sys.exit(cli())
File "/opt/homebrew/lib/python3.10/site-packages/hydra/main.py", line 90, in decorated_main
_run_hydra(
File "/opt/homebrew/lib/python3.10/site-packages/hydra/_internal/utils.py", line 394, in _run_hydra
_run_app(
File "/opt/homebrew/lib/python3.10/site-packages/hydra/_internal/utils.py", line 457, in _run_app
run_and_report(
File "/opt/homebrew/lib/python3.10/site-packages/hydra/_internal/utils.py", line 222, in run_and_report
raise ex
File "/opt/homebrew/lib/python3.10/site-packages/hydra/_internal/utils.py", line 219, in run_and_report
return func()
File "/opt/homebrew/lib/python3.10/site-packages/hydra/_internal/utils.py", line 458, in <lambda>
lambda: hydra.run(
File "/opt/homebrew/lib/python3.10/site-packages/hydra/_internal/hydra.py", line 132, in run
_ = ret.return_value
File "/opt/homebrew/lib/python3.10/site-packages/hydra/core/utils.py", line 260, in return_value
raise self._return_value
File "/opt/homebrew/lib/python3.10/site-packages/hydra/core/utils.py", line 186, in run_job
ret.return_value = task_function(task_cfg)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/cli.py", line 56, in cli
func(cfg)
File "/opt/homebrew/lib/python3.10/site-packages/hydra/main.py", line 79, in decorated_main
return task_function(cfg_passthrough)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/v8/detect/train.py", line 207, in train
model.train(**cfg)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/engine/model.py", line 193, in train
self.trainer.train()
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/engine/trainer.py", line 185, in train
self._do_train(int(os.getenv("RANK", -1)), world_size)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/engine/trainer.py", line 301, in _do_train
self.loss, self.loss_items = self.criterion(preds, batch)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/v8/detect/train.py", line 77, in criterion
return self.compute_loss(preds, batch)
File "/opt/homebrew/lib/python3.10/site-packages/ultralytics/yolo/v8/detect/train.py", line 168, in __call__
targets = self.preprocess(targets.to(self.device), batch_size, scale_tensor=imgsz[[1, 0, 1, 0]])
TypeError: Cannot convert a MPS Tensor to float64 dtype as the MPS framework doesn't support float64. Please use float32 instead.
I am taking this error in uwgan(GAN method)
I'm trying to adapt this code to Tf2: https://github.com/infrontofme/UWGAN_UIE
g_sum = tf.compat.v1.summary.merge([self.z_sum, self.d__sum, self.G_sum, self.d_loss_fake_sum, self.g_loss_sum])
d_sum = tf.compat.v1.summary.merge([self.z_sum, self.d_sum, self.d_loss_real_sum, self.d_loss_sum])
writer = tf.compat.v1.summary.FileWriter(config.log_dir, self.sess.graph)
`Traceback (most recent call last):
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 438, in _apply_op_helper
as_ref=input_arg.is_ref)
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\framework\ops.py", line 1608, in internal_convert_n_to_tensor
ctx=ctx))
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\profiler\trace.py", line 163, in wrapped
return func(*args, **kwargs)
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\framework\ops.py", line 1509, in convert_to_tensor
(dtype.name, value.dtype.name, value))
ValueError: Tensor conversion requested dtype string for Tensor with dtype bool: <tf.Tensor 'z_1/write_summary/Const:0' shape=() dtype=bool>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "uwgan_main.py", line 81, in <module>
tf.compat.v1.app.run()
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\absl\app.py", line 312, in run
_run_main(main, args)
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\absl\app.py", line 258, in _run_main
sys.exit(main(argv))
File "uwgan_main.py", line 72, in main
wgan.train(FLAGS)
File "D:\UWGAN\UWGAN\uwgan_model.py", line 167, in train
g_sum = tf.compat.v1.summary.merge([self.z_sum, self.d__sum, self.G_sum, self.d_loss_fake_sum, self.g_loss_sum])
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\summary\summary.py", line 371, in merge
val = _gen_logging_ops.merge_summary(inputs=inputs, name=name)
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\ops\gen_logging_ops.py", line 468, in merge_summary
"MergeSummary", inputs=inputs, name=name)
File "C:\Users\STEM_WS__AI\Anaconda3\envs\uwgan\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 460, in _apply_op_helper
(prefix, dtype.name))
TypeError: Tensors in list passed to 'inputs' of 'MergeSummary' Op have types [bool, bool, bool, string, string] that do not match expected type string.`
help me for this error
I used GAN and i try upgrade to tf2 this code.
Win 10 x64, conda, theano 0.9, python 3.6.1, spyder 3.1.4, IPython 6.0.0
When I test the code in scan api tutorial Iterating over the first dimension of a tensor: Calculating a polynomial , i.e.
import theano
import numpy as np
import theano.tensor as T
from theano import In
coefficients = theano.tensor.vector("coefficients")
x = T.scalar("x")
max_coefficients_supported = 10000
# Generate the components of the polynomial
components, updates = theano.scan(fn=lambda coefficient, power, free_variable: coefficient * (free_variable ** power),
outputs_info=None,
sequences=[coefficients, theano.tensor.arange(max_coefficients_supported)],
non_sequences=x)
# Sum them up
polynomial = components.sum()
# Compile a function
calculate_polynomial = theano.function(inputs=[coefficients, x], outputs=polynomial)
spyder throw the error :
ERROR (theano.gof.opt): Optimization failure due to: local_subtensor_merge
ERROR (theano.gof.opt): node: Subtensor{:int64:}(coefficients[0:], ScalarFromTensor.0)
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: Elemwise{switch,no_inplace}.0 has no test value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 1982, in process_node
replacements = lopt.transform(node)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 3051, in local_subtensor_merge
out = subtens(x, *sl_ins)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 615, in __call__
node = self.make_node(*inputs, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\subtensor.py", line 474, in make_node
inputs = tuple(self.my_as_scalar(a) for a in inputs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\subtensor.py", line 474, in <genexpr>
inputs = tuple(self.my_as_scalar(a) for a in inputs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\subtensor.py", line 459, in my_as_scalar
return theano.tensor.scalar_from_tensor(a)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (Elemwise{switch,no_inplace}.0) of Op ScalarFromTensor(Elemwise{switch,no_inplace}.0) missing default value.
ERROR (theano.gof.opt): Optimization failure due to: local_subtensor_merge
ERROR (theano.gof.opt): node: Subtensor{:int64:}(Subtensor{int64::}.0, ScalarFromTensor.0)
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: Elemwise{minimum,no_inplace}.0 has no test value
Backtrace when that variable is created:
File "C:\Users\sejab\Miniconda3\lib\site-packages\ipykernel\zmqshell.py", line 533, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2683, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2793, in run_ast_nodes
if self.run_code(code, result):
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2847, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-a340056dd686>", line 1, in <module>
runfile('D:/WorkSpace/Python/Bayes/temp_temp.py', wdir='D:/WorkSpace/Python/Bayes')
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/WorkSpace/Python/Bayes/temp_temp.py", line 25, in <module>
non_sequences=x)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 1982, in process_node
replacements = lopt.transform(node)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 3033, in local_subtensor_merge
ushape[pos_2]))
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 2880, in merge_two_slices
sl2, reverse2 = get_canonical_form_slice(slice2, len2)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\subtensor.py", line 155, in get_canonical_form_slice
stop_plus_len = stop + length
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\var.py", line 128, in __add__
return theano.tensor.basic.add(self, other)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (Elemwise{minimum,no_inplace}.0) of Op Elemwise{add,no_inplace}(Elemwise{minimum,no_inplace}.0, TensorConstant{10000}) missing default value.
Backtrace when that variable is created:
File "C:\Users\sejab\Miniconda3\lib\site-packages\ipykernel\zmqshell.py", line 533, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2683, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2793, in run_ast_nodes
if self.run_code(code, result):
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2847, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-a340056dd686>", line 1, in <module>
runfile('D:/WorkSpace/Python/Bayes/temp_temp.py', wdir='D:/WorkSpace/Python/Bayes')
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/WorkSpace/Python/Bayes/temp_temp.py", line 25, in <module>
non_sequences=x)
ERROR (theano.gof.opt): Optimization failure due to: local_shape_to_shape_i
ERROR (theano.gof.opt): node: Shape(coefficients[0:])
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: Elemwise{sub,no_inplace}.0 has no test value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 1982, in process_node
replacements = lopt.transform(node)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 1884, in local_shape_to_shape_i
ret = shape_feature.make_vector_shape(node.inputs[0])
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 1275, in make_vector_shape
return make_vector(*self.shape_of[r])
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (Elemwise{sub,no_inplace}.0) of Op MakeVector{dtype='int64'}(Elemwise{sub,no_inplace}.0) missing default value.
ERROR (theano.gof.opt): Optimization failure due to: local_shape_to_shape_i
ERROR (theano.gof.opt): node: Shape(coefficients)
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: Shape_i{0}.0 has no test value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 1982, in process_node
replacements = lopt.transform(node)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 1884, in local_shape_to_shape_i
ret = shape_feature.make_vector_shape(node.inputs[0])
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 1275, in make_vector_shape
return make_vector(*self.shape_of[r])
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (Shape_i{0}.0) of Op MakeVector{dtype='int64'}(Shape_i{0}.0) missing default value.
ERROR (theano.gof.opt): Optimization failure due to: local_shape_to_shape_i
ERROR (theano.gof.opt): node: Shape(coefficients)
ERROR (theano.gof.opt): TRACEBACK:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: Shape_i{0}.0 has no test value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 1982, in process_node
replacements = lopt.transform(node)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 1884, in local_shape_to_shape_i
ret = shape_feature.make_vector_shape(node.inputs[0])
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 1275, in make_vector_shape
return make_vector(*self.shape_of[r])
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (Shape_i{0}.0) of Op MakeVector{dtype='int64'}(Shape_i{0}.0) missing default value.
ERROR (theano.gof.opt): SeqOptimizer apply <theano.tensor.opt.FusionOptimizer object at 0x000002E6B6947860>
ERROR (theano.gof.opt): Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: <float64> has no test value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 235, in apply
sub_prof = optimizer.optimize(fgraph)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 87, in optimize
ret = self.apply(fgraph, *args, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 7289, in apply
new_outputs = self.optimizer(node)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\tensor\opt.py", line 7133, in local_fuse
return_list=True)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (<float64>) of Op pow(<float64>, <int64>) missing default value.
ERROR (theano.gof.opt): SeqOptimizer apply <theano.compile.mode.AddDestroyHandler object at 0x000002E6B539FA20>
ERROR (theano.gof.opt): Traceback:
ERROR (theano.gof.opt): Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 625, in __call__
storage_map[ins] = [self._get_test_value(ins)]
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 581, in _get_test_value
raise AttributeError('%s has no test value %s' % (v, detailed_err_msg))
AttributeError: Sum{acc_dtype=float64}.0 has no test value
Backtrace when that variable is created:
File "C:\Users\sejab\Miniconda3\lib\site-packages\ipykernel\zmqshell.py", line 533, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2683, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2793, in run_ast_nodes
if self.run_code(code, result):
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2847, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-a340056dd686>", line 1, in <module>
runfile('D:/WorkSpace/Python/Bayes/temp_temp.py', wdir='D:/WorkSpace/Python/Bayes')
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/WorkSpace/Python/Bayes/temp_temp.py", line 27, in <module>
polynomial = components.sum()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 235, in apply
sub_prof = optimizer.optimize(fgraph)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\opt.py", line 87, in optimize
ret = self.apply(fgraph, *args, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\compile\mode.py", line 103, in apply
fgraph.replace_validate(o, _output_guard(o),
File "C:\Users\sejab\Miniconda3\lib\site-packages\theano\gof\op.py", line 639, in __call__
(i, ins, node, detailed_err_msg))
ValueError: Cannot compute test value: input 0 (Sum{acc_dtype=float64}.0) of Op OutputGuard(Sum{acc_dtype=float64}.0) missing default value.
Backtrace when that variable is created:
File "C:\Users\sejab\Miniconda3\lib\site-packages\ipykernel\zmqshell.py", line 533, in run_cell
return super(ZMQInteractiveShell, self).run_cell(*args, **kwargs)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2683, in run_cell
interactivity=interactivity, compiler=compiler, result=result)
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2793, in run_ast_nodes
if self.run_code(code, result):
File "C:\Users\sejab\Miniconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2847, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-a340056dd686>", line 1, in <module>
runfile('D:/WorkSpace/Python/Bayes/temp_temp.py', wdir='D:/WorkSpace/Python/Bayes')
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)
File "C:\Users\sejab\Miniconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/WorkSpace/Python/Bayes/temp_temp.py", line 27, in <module>
polynomial = components.sum()
Because other code runs well, it seems theano.function induced the problem. Although I tried use In() to add test value to coefficients and x, the problem also stand there.
Ok, I have found a similar question on the official site Creating a step-function: Optimization failure due to: local_subtensor_merge. It may be caused by Pymc3 default settings. There they gave several ways. I use test values as noted in the last comment and set
theano.config.compute_test_value = "warn"
the errors are removed.