ermongroup / necst

Neural Joint-Source Channel Coding
45 stars 15 forks source link

Meet error when using the randomly generated sequences #2

Open DXQer opened 3 years ago

DXQer commented 3 years ago

Thanks for your great works. I encountered something wrong when I ran the following commands. How can I solve this problem?

My scripts:

Generate a random sequence with bits of 100 python3.6 data_setup/gen_random_bits.py ./data/random 100

Generate a tfrecords file corresponding to the dataset python3.6 data_setup/convert_to_records.py --dataset=random

Train the model python3.6 main.py --datadir=./data --datasource=random --channel_model=bsc --noise=0.1 --test_noise=0.1 --n_bits=100 --is_binary=True

The error messages are as follows:

Traceback (most recent call last): File "main.py", line 129, in main() File "main.py", line 107, in main model = model_class(sess, datasource) File "./necst-master/necst.py", line 109, in init self.theta_loss, self.phi_loss, self.reconstr_loss = self.vimco_loss(self.x, self.x_reconstr_logits) File "./necst-master/necst.py", line 527, in vimco_loss x = tf.tile(x, [self.vimco_samples, 1, 1]) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 10105, in tile "Tile", input=input, multiples=multiples, name=name) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1823, in init control_input_ops) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1662, in _create_c_op raise ValueError(str(e)) ValueError: Shape must be rank 5 but is rank 3 for 'Tile' (op: 'Tile') with input shapes: [1,?,100,100,3], [3].

YuyXiang commented 2 years ago

Thanks for your great works. I encountered something wrong when I ran the following commands. How can I solve this problem?

My scripts: Generate a random sequence with bits of 100 python3.6 data_setup/gen_random_bits.py ./data/random 100

Generate a tfrecords file corresponding to the dataset python3.6 data_setup/convert_to_records.py --dataset=random

Train the model python3.6 main.py --datadir=./data --datasource=random --channel_model=bsc --noise=0.1 --test_noise=0.1 --n_bits=100 --is_binary=True

The error messages are as follows: Traceback (most recent call last): File "main.py", line 129, in main() File "main.py", line 107, in main model = model_class(sess, datasource) File "./necst-master/necst.py", line 109, in init self.theta_loss, self.phi_loss, self.reconstr_loss = self.vimco_loss(self.x, self.x_reconstr_logits) File "./necst-master/necst.py", line 527, in vimco_loss x = tf.tile(x, [self.vimco_samples, 1, 1]) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 10105, in tile "Tile", input=input, multiples=multiples, name=name) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func return func(*args, kwargs) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op op_def=op_def) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1823, in init** control_input_ops) File "./python3.6.9/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1662, in _create_c_op raise ValueError(str(e)) ValueError: Shape must be rank 5 but is rank 3 for 'Tile' (op: 'Tile') with input shapes: [1,?,100,100,3], [3].

Hi! I have encountered the same problem. :( If you have solved it, could you provide a solution? Thank you!

Aliiiqbp commented 9 months ago

Same Problem :(