我从这个网站http://mnbayazit.com/406/bayazit下载了源代码
这个项目有一些依赖:
库:FTGL(用于字体),FreeType2(FTGL需要),GLFW(用于Windows和键盘输入),OpenGL.软件:CMake(如果它不构建)但我遇到了问题.
安装指南看起来像
构建和运行:
cmake .
make
./conv
Run Code Online (Sandbox Code Playgroud)
而我正在努力建立它.
$ cmake .
Run Code Online (Sandbox Code Playgroud)
很好,但是当我想要的时候
$ make
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
Linking CXX executable conv
/usr/bin/ld: /usr/local/lib/libglfw.a(x11_init.o): undefined reference to symbol 'pthread_kill@@GLIBC_2.0'
/usr/bin/ld: note: 'pthread_kill@@GLIBC_2.0' is defined in DSO /lib/i386-linux-gnu/libpthread.so.0 so try adding it to the linker command line
/lib/i386-linux-gnu/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [conv] Error 1
make[1]: *** [CMakeFiles/conv.dir/all] Error 2
make: *** [all] Error 2
Run Code Online (Sandbox Code Playgroud)
我用Google搜索了这个问题,并尝试通过更改来更改CMakeLists.txt
SET(CMAKE_BUILD_TYPE distribution)
SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O3") …Run Code Online (Sandbox Code Playgroud) 在tensorflow教程中,使用MNIST数据集提供TFRecords的示例.MNIST数据集转换为TFRecords文件,如下所示:
def convert_to(data_set, name):
images = data_set.images
labels = data_set.labels
num_examples = data_set.num_examples
if images.shape[0] != num_examples:
raise ValueError('Images size %d does not match label size %d.' %
(images.shape[0], num_examples))
rows = images.shape[1]
cols = images.shape[2]
depth = images.shape[3]
filename = os.path.join(FLAGS.directory, name + '.tfrecords')
print('Writing', filename)
writer = tf.python_io.TFRecordWriter(filename)
for index in range(num_examples):
image_raw = images[index].tostring()
example = tf.train.Example(features=tf.train.Features(feature={
'height': _int64_feature(rows),
'width': _int64_feature(cols),
'depth': _int64_feature(depth),
'label': _int64_feature(int(labels[index])),
'image_raw': _bytes_feature(image_raw)}))
writer.write(example.SerializeToString())
writer.close()
Run Code Online (Sandbox Code Playgroud)
然后它被重新加载并解码如下:
def read_and_decode(filename_queue):
reader = tf.TFRecordReader()
_, serialized_example …Run Code Online (Sandbox Code Playgroud)