I am getting this problem each time I try to use a learner with gaussian_noise_injection_std_dev>0.
According to an answer provided to issue #444 on the GitHub site, the solution is to do initialization on CPU, but I can't find this option in the Python APIs.
CURAND failure 105: (see curand.h & look for curandStatus or CURAND_STATUS_xxx) ; GPU=0 ; hostname=ROSIE ; expr=curandGenerateNormal(((curandGenerator_t*) s_curandGenerator)[0], reinterpret_cast(Data()), GetNumElements(), (float) mean, (float) sigma)
Traceback (most recent call last):
File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 5, in
trainer.train_minibatch(data) # update model with it
File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\cntk\trainer.py", line 120, in train_minibatch
arguments, device)
File "C:\local\Anaconda3-4.1.1-Windows-x86_64\envs\cntk-py35\lib\site-packages\cntk\cntk_py.py", line 2022, in train_minibatch_overload_for_minibatchdata
return _cntk_py.Trainer_train_minibatch_overload_for_minibatchdata(self, args)
RuntimeError: CURAND failure 105: (see curand.h & look for curandStatus or CURAND_STATUS_xxx) ; GPU=0 ; hostname=ROSIE ; expr=curandGenerateNormal(((curandGenerator_t) s_curandGenerator)[0], reinterpret_cast(Data()), GetNumElements(), (float) mean, (float) sigma)
[CALL STACK]
Microsoft::MSR::CNTK::CudaTimer:: Stop
- Microsoft::MSR::CNTK::GPUMatrix:: SetGaussianRandomValue
- Microsoft::MSR::CNTK::Matrix:: SetGaussianRandomValue
- CNTK::Internal:: ZeroesWithDynamicAxesLike
- CNTK::Internal:: ZeroesWithDynamicAxesLike
- CNTK:: SGDLearner
- CNTK::TrainingParameterSchedule:: Serialize
- CNTK::Trainer:: TotalNumberOfSamplesSeen
- CNTK::Trainer:: TrainMinibatch
- CNTK::Trainer:: TrainMinibatch
- PyInit__cntk_py
- PyInit__cntk_py
- PyCFunction_Call
- PyEval_GetFuncDesc
- PyEval_EvalFrameEx
- PyEval_EvalFrameEx
I have GTX 970, 4GB, running beta 12 on Win10.
Regards,
Slawek
The fix for this is now in master. CNTK 2.0rc2 will work correctly.
Related
im trying to get netbox to get configs using NAPALM, but even the basic connection using napalm isnt working, always errors around the key file, which we need to use (cannot use password).
napalm==3.4.1
python=3.8
referred to the documentation at https://napalm.readthedocs.io/en/latest/support/ for use of arguments
I can directly SSH to the router using the key in ~/.ssh/ for the user netbox
netbox#netbox:~/.ssh$ ssh -c aes128-cbc netbox#172.1.1.1
The authenticity of host '172.1.1.1 (172.1.1.1)' can't be established.
RSA key fingerprint is SHA256:<fingerprinthere>.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.1.1.1' (RSA) to the list of known hosts.
PHC-SW01>
Prompts for password and fails
napalm --user netbox --vendor ios --optional_args 'use_keys=true, secret=passwordhere' --debug 172.1.1.1 call get_facts
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
Enter password:
2022-08-24 13:03:01,926 - napalm - DEBUG - Starting napalm's debugging tool
2022-08-24 13:03:01,926 - napalm - DEBUG - Gathering napalm packages
2022-08-24 13:03:01,926 - napalm - DEBUG - napalm==3.4.1
2022-08-24 13:03:01,926 - napalm - DEBUG - get_network_driver - Calling with args: ('ios',), {}
2022-08-24 13:03:01,927 - napalm - DEBUG - get_network_driver - Successful
Traceback (most recent call last):
File "/usr/local/bin/napalm", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 308, in main
run_tests(args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 269, in run_tests
optional_args = helpers.parse_optional_args(args.optional_args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 131, in parse_optional_args
return {
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 132, in <dictcomp>
x.split("=")[0]: ast.literal_eval(x.split("=")[1])
File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.8/ast.py", line 98, in _convert
return _convert_signed_num(node)
File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
return _convert_num(node)
File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
_raise_malformed_node(node)
File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: <_ast.Name object at 0x7fa719a35af0>
napalm --user netbox --password '' --vendor ios --optional_args 'use_keys=true, secret=passwordhere' --debug 172.1.1.1 call get_facts
warnings.warn(
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
2022-08-24 13:05:13,330 - napalm - DEBUG - Starting napalm's debugging tool
2022-08-24 13:05:13,330 - napalm - DEBUG - Gathering napalm packages
2022-08-24 13:05:13,331 - napalm - DEBUG - napalm==3.4.1
2022-08-24 13:05:13,331 - napalm - DEBUG - get_network_driver - Calling with args: ('ios',), {}
2022-08-24 13:05:13,331 - napalm - DEBUG - get_network_driver - Successful
Traceback (most recent call last):
File "/usr/local/bin/napalm", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 308, in main
run_tests(args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 269, in run_tests
optional_args = helpers.parse_optional_args(args.optional_args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 131, in parse_optional_args
return {
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 132, in <dictcomp>
x.split("=")[0]: ast.literal_eval(x.split("=")[1])
File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.8/ast.py", line 98, in _convert
return _convert_signed_num(node)
File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
return _convert_num(node)
File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
_raise_malformed_node(node)
File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: <_ast.Name object at 0x7f86f4974b80>
napalm --user netbox --vendor ios --optional_args 'alt_host_keys=True, alt_key_file=/home/netbox/.ssh/id_rsa' --debug 172.1.1.1 call get_facts
Prompts for password, when entered gives below.. shouldnt need password when keyfile is used.
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
Enter password:
2022-08-24 13:14:59,741 - napalm - DEBUG - Starting napalm's debugging tool
2022-08-24 13:14:59,741 - napalm - DEBUG - Gathering napalm packages
2022-08-24 13:14:59,741 - napalm - DEBUG - napalm==3.4.1
2022-08-24 13:14:59,741 - napalm - DEBUG - get_network_driver - Calling with args: ('ios',), {}
2022-08-24 13:14:59,742 - napalm - DEBUG - get_network_driver - Successful
Traceback (most recent call last):
File "/usr/local/bin/napalm", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 308, in main
run_tests(args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 269, in run_tests
optional_args = helpers.parse_optional_args(args.optional_args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 131, in parse_optional_args
return {
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 132, in <dictcomp>
x.split("=")[0]: ast.literal_eval(x.split("=")[1])
File "/usr/lib/python3.8/ast.py", line 59, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
File "/usr/lib/python3.8/ast.py", line 47, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
/home/netbox/.ssh/id_rsa
^
SyntaxError: invalid syntax
napalm --user netbox --vendor ios --optional_args "hostkey_verify=False, look_for_keys=true, key_file=~/.ssh/id_rsa" --debug 172.1.1.1 call get_facts
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: 0.18ubuntu0.18.04.1 is an invalid version and will not be supported in a future release
warnings.warn(
Enter password:
2022-08-24 13:18:37,500 - napalm - DEBUG - Starting napalm's debugging tool
2022-08-24 13:18:37,501 - napalm - DEBUG - Gathering napalm packages
2022-08-24 13:18:37,501 - napalm - DEBUG - napalm==3.4.1
2022-08-24 13:18:37,501 - napalm - DEBUG - get_network_driver - Calling with args: ('ios',), {}
2022-08-24 13:18:37,501 - napalm - DEBUG - get_network_driver - Successful
Traceback (most recent call last):
File "/usr/local/bin/napalm", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 308, in main
run_tests(args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/cl_napalm.py", line 269, in run_tests
optional_args = helpers.parse_optional_args(args.optional_args)
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 131, in parse_optional_args
return {
File "/usr/local/lib/python3.8/dist-packages/napalm/base/clitools/helpers.py", line 132, in <dictcomp>
x.split("=")[0]: ast.literal_eval(x.split("=")[1])
File "/usr/lib/python3.8/ast.py", line 99, in literal_eval
return _convert(node_or_string)
File "/usr/lib/python3.8/ast.py", line 98, in _convert
return _convert_signed_num(node)
File "/usr/lib/python3.8/ast.py", line 75, in _convert_signed_num
return _convert_num(node)
File "/usr/lib/python3.8/ast.py", line 66, in _convert_num
_raise_malformed_node(node)
File "/usr/lib/python3.8/ast.py", line 63, in _raise_malformed_node
raise ValueError(f'malformed node or string: {node!r}')
ValueError: malformed node or string: <_ast.Name object at 0x7ff3a5c5e6d0>
If i specify --password '' it doesnt prompt for the password.
If i use "alt_key_file" or "key_file" always has the same error:
SyntaxError: invalid syntax
running napalm as user 'netbox' accessing the keyfile should work.
Update:
tried putting quotes within quotes re: https://github.com/napalm-automation/napalm-base/issues/309#issuecomment-461185980
but didnt work
--optional_args "hostkey_verify=False, look_for_keys=true, key_file='~/.ssh/id_rsa'"
by putting quotes within each variable i was able to get the command to work
napalm --user netbox --password '' --vendor ios --optional_args "alt_host_keys='True',alt_key_file='/home/netbox/.ssh/id_rsa'" --debug 172.16.1.1 call get_facts
its failing on the enable after connection, but its connecting using the SSH Key now which is what this was about.
I have some difficulty with tensorflow_datasets when I was trying to load mnist.
python:3.7
tensorflow : 2.1.0
tensorflow_datasets has been upgraded to latest version 4.6, because the default version of tensorflow_datasets from tensorflow installation has no attribute 'load'
But now the problem is data can not be downloaded and extracted successfully.
with the following command:
datasets = tfds.load(name="mnist")
the error message is :
Downloading and preparing dataset Unknown size (download: Unknown size, generated: Unknown size, total: Unknown size) to ~\tensorflow_datasets\mnist\3.0.1...
Extraction completed...: 0 file [00:00, ? file/s]██████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 138.37 url/s]
Dl Size...: 100%|██████████████████████████████████████████████████████████████████████████| 11594722/11594722 [00:00<00:00, 373172106.07 MiB/s]
Dl Completed...: 100%|█████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 122.03 url/s]
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\core\load.py", line 327, in load
dbuilder.download_and_prepare(**download_and_prepare_kwargs)
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\core\dataset_builder.py", line 483, in download_and_prepare
download_config=download_config,
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\core\dataset_builder.py", line 1222, in _download_and_prepare
disable_shuffling=self.info.disable_shuffling,
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\core\split_builder.py", line 310, in submit_split_generation
return self._build_from_generator(**build_kwargs)
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\core\split_builder.py", line 376, in _build_from_generator
leave=False,
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tqdm\std.py", line 1195, in iter
for obj in iterable:
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\image_classification\mnist.py", line 151, in _generate_examples
images = _extract_mnist_images(data_path, num_examples)
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_datasets\image_classification\mnist.py", line 350, in _extract_mnist_images
f.read(16) # header
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_core\python\lib\io\file_io.py", line 122, in read
self._preread_check()
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_core\python\lib\io\file_io.py", line 84, in _preread_check
compat.as_bytes(self.__name), 1024 * 512)
File "C:\Users\Wilso\Anaconda3\envs\tfgpu\lib\site-packages\tensorflow_core\python\util\compat.py", line 87, in as_bytes
(bytes_or_text,))
TypeError: Expected binary or unicode string, got WindowsGPath('C:\Users\Wilso\tensorflow_datasets\downloads\extracted\GZIP.cvdf-datasets_mnist_train-images-idx3-ubyteRA_Kv3PMVG-iFHXoHqNwJlYF9WviEKQCTSyo8gNSNgk.gz')
Try:
(ds_train, ds_test), ds_info = tfds.load(
"mnist",
split=["train", "test"],
shuffle_files=True,
as_supervised=True, # will return tuple (img, label) otherwise dict
with_info=True, # able to get info about dataset
)
I am testing Yolo-v3 (https://github.com/experiencor/keras-yolo3) with tensorflow-gpu 1.15 an keras 2.3.1. The training process is started by:
runfile("train.py",'-c config.json')
Here are the printed out messages:
Using TensorFlow backend.
WARNING:tensorflow:From train.py:40: The name tf.keras.backend.set_session is deprecated. Please use tf.compat.v1.keras.backend.set_session instead.
valid_annot_folder not exists. Spliting the trainining set.
Seen labels: {'kangaroo': 266}
Given labels: ['kangaroo']
Training on: ['kangaroo']
WARNING:tensorflow:From C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\ops\resource_variable_ops.py:1630: calling BaseResourceVariable.__init__ (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.
.....
Loading pretrained weights.
C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\callbacks\callbacks.py:998: UserWarning: `epsilon` argument is deprecated and will be removed, use `min_delta` instead.
warnings.warn('`epsilon` argument is deprecated and '
Traceback (most recent call last):
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call
return fn(*args)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 1348, in _run_fn
self._extend_graph()
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 1388, in _extend_graph
tf_session.ExtendSession(self._session)
InvalidArgumentError: Cannot assign a device for operation replica_0/lambda_1/Shape: {{node replica_0/lambda_1/Shape}} was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.
[[replica_0/lambda_1/Shape]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "train.py", line 305, in <module>
_main_(args)
File "train.py", line 282, in _main_
max_queue_size = 8
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\engine\training.py", line 1732, in fit_generator
initial_epoch=initial_epoch)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\engine\training_generator.py", line 42, in fit_generator
model._make_train_function()
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\engine\training.py", line 333, in _make_train_function
**self._function_kwargs)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\backend\tensorflow_backend.py", line 3006, in function
v1_variable_initialization()
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\backend\tensorflow_backend.py", line 420, in v1_variable_initialization
session = get_session()
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\keras\backend\tensorflow_backend.py", line 385, in get_session
return tf_keras_backend.get_session()
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\keras\backend.py", line 486, in get_session
_initialize_variables(session)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\keras\backend.py", line 903, in _initialize_variables
[variables_module.is_variable_initialized(v) for v in candidate_vars])
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
run_metadata_ptr)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
run_metadata)
File "C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
InvalidArgumentError: Cannot assign a device for operation replica_0/lambda_1/Shape: node replica_0/lambda_1/Shape (defined at C:\Users\Dy\Anaconda3\envs\tf1x\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.
[[replica_0/lambda_1/Shape]]
I don't understand what caused the InvalidArgumentError. Is my tensoflow-gpu not installed correctly? Or there is some conflict in deploying gpu?
Try changing the "gpus" value to "0" if it is anythong else. It should work if you are executing in GPU.
I'm completely new to cntk. I recently installed cntk 2.7 (GPU version) on my pc (windows 10,i5-7200U CPU) with GeForce 940MX GPU. I'm trying to set up cntk and the faster rcnn object-detection example provided in the link below
https://learn.microsoft.com/en-us/cognitive-toolkit/object-detection-using-faster-r-cnn
I'm trying to run the toy example.
After running the install_data_and_model.py in Examples/Image/Detection/FastRCNN folder
I run the run_faster_rcnn.py Examples/Image/Detection/FasterRCNN folder
I get the following error:
Selected GPU[0] GeForce 940MX as the process wide default device.
About to throw exception 'Failed to parse Dictionary from the input stream.'
Traceback (most recent call last):
File "run_faster_rcnn.py", line 34, in
trained_model = train_faster_rcnn(cfg)
File "C:\Users\HP-PC\Anaconda3\Lib\site-packages\cntk\Examples\Image\Detection\FasterRCNN\FasterRCNN_train.py", line 291, in train_faster_rcnn
eval_model = train_faster_rcnn_e2e(cfg)
File "C:\Users\HP-PC\Anaconda3\Lib\site-packages\cntk\Examples\Image\Detection\FasterRCNN\FasterRCNN_train.py", line 314, in train_faster_rcnn_e2e
loss, pred_error = create_faster_rcnn_model(image_input, roi_input, dims_node, cfg)
File "C:\Users\HP-PC\Anaconda3\Lib\site-packages\cntk\Examples\Image\Detection\FasterRCNN\FasterRCNN_train.py", line 177, in create_faster_rcnn_model
base_model = load_model(cfg['BASE_MODEL_PATH'])
File "C:\Users\HP-PC\Anaconda3\lib\site-packages\cntk\internal\swig_helper.py", line 69, in wrapper
result = f(*args, **kwds)
File "C:\Users\HP-PC\Anaconda3\lib\site-packages\cntk\ops\functions.py", line 1721, in load_model
return Function.load(model, device, format)
File "C:\Users\HP-PC\Anaconda3\lib\site-packages\cntk\internal\swig_helper.py", line 69, in wrapper
result = f(*args, **kwds)
File "C:\Users\HP-PC\Anaconda3\lib\site-packages\cntk\ops\functions.py", line 1635, in load
return cntk_py.Function.load(str(model), device, format.value)
RuntimeError: Failed to parse Dictionary from the input stream.
[CALL STACK]
> CNTK::Internal:: UseSparseGradientAggregationInDataParallelSGD
- CNTK::operator>>
- CNTK::Function:: Load
- PyInit__cntk_py (x2)
- PyCFunction_Call
- PyEval_GetFuncDesc
- PyEval_EvalFrameEx (x2)
- PyFunction_SetAnnotations
- PyObject_Call
- PyEval_GetFuncDesc
- PyEval_EvalFrameEx (x2)
- PyEval_GetFuncDesc (x2)
Can someone help me with what the issue is all about?
This error always happen when you shutdown cntk when last model was saving,so the model file break
System information
Running Python 3.6.4 on Windows
Describe the problem
I'm trying to run Tensorflow's lm_1b on sample mode, by inputting:
$ bazel-bin/lm_1b/lm_1b_eval --mode sample --prefix "I love that I" --pbtxt data/vocab-2016-09-10.txt --vocab_file data/vocab-2016-09-10.txt --ckpt 'data/ckpt-*'
But I get the error:
google.protobuf.text_format.ParseError: 1:1 : Expected identifier or number, got <.
Any help would really be appreciated
Source code / logs
Recovering graph.
Traceback (most recent call last):
File "\\?\C:\Users\snmsa\AppData\Local\Temp\Bazel.runfiles_9sq54ngc\runfiles\__main__\lm_1b\lm_1b_eval.py", line 308, in <module>
tf.app.run()
File "C:\Users\snmsa\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "\\?\C:\Users\snmsa\AppData\Local\Temp\Bazel.runfiles_9sq54ngc\runfiles\__main__\lm_1b\lm_1b_eval.py", line 298, in main
_SampleModel(FLAGS.prefix, vocab)
File "\\?\C:\Users\snmsa\AppData\Local\Temp\Bazel.runfiles_9sq54ngc\runfiles\__main__\lm_1b\lm_1b_eval.py", line 174, in _SampleModel
sess, t = _LoadModel(FLAGS.pbtxt, FLAGS.ckpt)
File "\\?\C:\Users\snmsa\AppData\Local\Temp\Bazel.runfiles_9sq54ngc\runfiles\__main__\lm_1b\lm_1b_eval.py", line 89, in _LoadModel
text_format.Merge(s, gd)
File "C:\Users\snmsa\Anaconda3\lib\site-packages\google\protobuf\text_format.py", line 533, in Merge
descriptor_pool=descriptor_pool)
File "C:\Users\snmsa\Anaconda3\lib\site-packages\google\protobuf\text_format.py", line 587, in MergeLines
return parser.MergeLines(lines, message)
File "C:\Users\snmsa\Anaconda3\lib\site-packages\google\protobuf\text_format.py", line 620, in MergeLines
self._ParseOrMerge(lines, message)
File "C:\Users\snmsa\Anaconda3\lib\site-packages\google\protobuf\text_format.py", line 635, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "C:\Users\snmsa\Anaconda3\lib\site-packages\google\protobuf\text_format.py", line 679, in _MergeField
name = tokenizer.ConsumeIdentifierOrNumber()
File "C:\Users\snmsa\Anaconda3\lib\site-packages\google\protobuf\text_format.py", line 1152, in ConsumeIdentifierOrNumber
raise self.ParseError('Expected identifier or number, got %s.' % result)
google.protobuf.text_format.ParseError: 1:1 : Expected identifier or number, got <.
Your command line is wrong. It should be:
bazel-bin/lm_1b/lm_1b_eval --mode sample \
--prefix "I love that I" \
--pbtxt data/graph-2016-09-10.pbtxt \
...
You are passing a vocabulary file --pbtxt data/vocab-2016-09-10.txt where a serialized GraphDef file is expected.