Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_weights #6

Open
saras022 opened this issue Nov 21, 2019 · 2 comments
Open

load_weights #6

saras022 opened this issue Nov 21, 2019 · 2 comments

Comments

@saras022
Copy link

The weight folder is missing. The jupyter notebook try to load the weight from a file called g_epoch_049.hdf5 which cannot be found anywhere in the repo. Also most of the PDSF urls are broken.

@bnachman
Copy link
Collaborator

Hi @saras022,

The PDSF links are for running on the Berkeley computing system, but that should not be necessary - we have provided the samples via Zenodo. You will have to train the NN to generate weights files.

@saras022
Copy link
Author

I tried that but I get these errors below and I don't know why. Does it not work if I run it on conda or docker type environment?

File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 527, in _apply_op_helper
preferred_dtype=default_dtype)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1224, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 305, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 246, in constant
allow_broadcast=True)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 284, in _constant_impl
allow_broadcast=allow_broadcast))
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py", line 475, in make_tensor_proto
_GetDenseDimensions(values)))
ValueError: Argument must be a dense tensor: range(1, 4) - got shape [3], but wanted [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 541, in _apply_op_helper
values, as_ref=input_arg.is_ref).dtype.name
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/ops.py", line 1224, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 305, in _constant_tensor_conversion_function
return constant(v, dtype=dtype, name=name)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 246, in constant
allow_broadcast=True)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/constant_op.py", line 284, in _constant_impl
allow_broadcast=allow_broadcast))
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/tensor_util.py", line 475, in make_tensor_proto
_GetDenseDimensions(values)))
ValueError: Argument must be a dense tensor: range(1, 4) - got shape [3], but wanted [].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/saras022/CaloGAN-master/models/train.py", line 233, in
sparsity_mbd=True
File "/home/saras022/CaloGAN-master/models/architectures.py", line 111, in build_discriminator
empirical_sparsity = sparsity_detector(image)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/keras/engine/base_layer.py", line 457, in call
output = self.call(inputs, **kwargs)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/keras/layers/core.py", line 687, in call
return self.function(inputs, **arguments)
File "/home/saras022/CaloGAN-master/models/ops.py", line 105, in sparsity_level
K.cast(x > 0.0, K.floatx()), axis=range(1, len(_shape))
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 1288, in sum
return tf.reduce_sum(x, axis, keepdims)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py", line 1410, in reduce_sum_v1
return reduce_sum(input_tensor, axis, keepdims, name)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/util/dispatch.py", line 180, in wrapper
return target(*args, **kwargs)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/ops/math_ops.py", line 1458, in reduce_sum
name=name))
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 10935, in _sum
name=name)
File "/home/saras022/anaconda2/envs/PythonCharmer/lib/python3.7/site-packages/tensorflow/python/framework/op_def_library.py", line 545, in _apply_op_helper
(input_name, err))
ValueError: Tried to convert 'reduction_indices' to a tensor and failed. Error: Argument must be a dense tensor: range(1, 4) - got shape [3], but wanted [].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants